Sindbad~EG File Manager

Current Path : /opt/nginxhttpd_/vendor/extensions-cpanel/cpanel-development-lib/src/Framework/
Upload File :
Current File : //opt/nginxhttpd_/vendor/extensions-cpanel/cpanel-development-lib/src/Framework/Router.php

<?php


namespace O2switch\CpanelLib\Framework;

use Symfony\Component\HttpFoundation\Request;

class Router
{
    /**
     * @var array
     */
    private $routes;

    public function __construct(array $routes){
        $this->routes = $routes;
    }

    /**
     * @return array
     */
    public function match(Request $request){
        if($request->query->has('r')){
            return isset($this->routes[$request->query->get('r')])
                ? $this->routes[$request->query->get('r')]
                : $this->http404();
        }
        return $this->routes['index'];
    }

    public function http404(){
        return $this->routes[404];
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists