for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nip\Router\Loader;
use Symfony\Component\Config\Loader\DelegatingLoader as SymfonyDirectoryLoader;
use Symfony\Component\Routing\RouteCollection;
/**
* Class DelegatingLoader
* @package Nip\Router\Loader
*/
class DelegatingLoader extends SymfonyDirectoryLoader
{
* {@inheritdoc}
public function load($file, $type = null)
$collection = parent::load($file, $type);
return $this->transformCollection($collection);
}
* @param RouteCollection $symfonyCollection
* @return \Nip\Router\RouteCollection
protected function transformCollection(RouteCollection $symfonyCollection)
$collection = new \Nip\Router\RouteCollection();
$collection->addCollection($symfonyCollection);
$symfonyCollection
object<Symfony\Component\Routing\RouteCollection>
object<self>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
return $collection;
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: