public function sortChildren()
    {
        if ($this->hasChildren()) {
            /** @var RouteDefinition $definition */
            foreach ($this->children as $definition) {
                $definition->sortChildren();
            }
            uasort($this->children, function ($a, $b) {
                /** @var RouteDefinition $a */
                /** @var RouteDefinition $b */
                if ($a->getPosition() == $b->getPosition()) {
                    return 0;
                }
                return $a->getPosition() < $b->getPosition() ? -1 : 1;
            });
        }
    }