for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Router\RouteCollections\Traits;
use Nip\Router\Route\Route;
/**
* Trait CollectionsOperationsTrait
* @package Nip\Router\RouteCollections\Traits
*/
trait CollectionsOperationsTrait
{
* @inheritdoc
* @deprecated Use all()
public function getRoutes()
return $this->all();
all()
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return $this->/** @scrutinizer ignore-call */ all();
}
* @param array $routes
public function setRoutes($routes)
foreach ($routes as $route) {
$this->addRoute($route);
* @param Route $route
public function prependRoute($route)
$routes = $this->all();
$this->setRoutes($routes);
* @param $route
* @return bool
public function has($route)
$name = $route instanceof Route ? $route->getName() : $route;
return $this->get($name) instanceof Route;
* @return Route|\Symfony\Component\Routing\Route|null
public function get($route)
return parent::get($name);
* @param null $name
$name
null
* @return
public function addRoute($route, $name = null)
if ($name) {
false
$route->setName($name);
} else {
$name = $route->getName();
return $this->add($name, $route);
add()
return $this->/** @scrutinizer ignore-call */ add($name, $route);