for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the DS Framework.
*
* (c) Dan Smith <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Ds\Router\Loaders;
use Ds\Router\Exceptions\RouterException;
use Ds\Router\Interfaces\LoaderInterface;
use Ds\Router\Interfaces\RouteCollectionInterface;
use Ds\Router\Interfaces\RouterInterface;
* Abstract Loader
* @package Ds\Router\Loaders
* @author Dan Smith <[email protected]>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
abstract class AbstractLoader implements LoaderInterface
{
* @var RouterInterface
protected $router;
* Load Route File.
* @param string $file Route filename.
* @return RouteCollectionInterface
* @throws RouterException
abstract public function loadFile(string $file);
* Load multiple route files.
* @param array $files
* @return RouterInterface
abstract public function loadFiles(array $files);
* With Router.
* @param RouterInterface $router
* @return LoaderInterface
public function withRouter(RouterInterface $router)
$new = clone $this;
$new->router = $router;
return $new;
}
* Get Router.
public function getRouter()
return $this->router;