src/Router.php
private function setMainController(string $route): bool
    {
        if (!\is_dir($route)) return false;

        foreach ($this->requestNames[$this->requestType] as $requestName)
        {
            $path = $route . '/' . $requestName;

            if (\is_file($path)) {
                $this->absolutePathToMainController = $path;
                return true;
            }
        }
        return false;
    }
private function setMainController(string $route): bool
    {
        if (!\is_dir($route)) return false;

        foreach ($this->requestNames[$this->requestType] as $requestName)
        {
            $path = $route . '/' . $requestName;

            if (\is_file($path)) {
                $this->absolutePathToMainController = $path;
                return true;
            }
        }
        return false;
    }
private function setMainController ( string $ route ) : bool { if ( ! \ is_dir ( $ route ) ) return false ; foreach ( $ this -> requestNames [ $ this -> requestType ] as $ requestName ) { $ path = $ route . '/' . $ requestName ; if ( \ is_file ( $ path ) ) { $ this -> absolutePathToMainController = $ path ; return true ; } } return false ; }
Set the main controller closure to the most fitting controller.

@param string $route

@return bool true if a controller was found, false otherwise
Set the main controller closure to the most fitting controller .