public function sortArguments()
    {
        $arguments = array();

        $expectedArguments = $this->di->get('argument')->getExpectedOrder();

        foreach ($expectedArguments as $pos => $key) {
            if (array_key_exists($pos, $this->arguments)) {
                $arguments[$key] = $this->di->get('argument')->validate($key, $this->arguments[$pos]);
            } else {
                $this->di->get('argument')->validate($key, null);
            }
        }

        $this->di->get('argument')->load($arguments);
    }