for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of Collision.
*
* (c) Nuno Maduro <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace NunoMaduro\Collision;
use Whoops\Run;
use Whoops\RunInterface;
use NunoMaduro\Collision\Contracts\Handler as HandlerContract;
use NunoMaduro\Collision\Contracts\Provider as ProviderContract;
* This is an Collision Provider implementation.
* @author Nuno Maduro <[email protected]>
class Provider implements ProviderContract
{
* Holds an instance of the Run.
* @var \Whoops\RunInterface
protected $run;
* Holds an instance of the handler.
* @var \NunoMaduro\Collision\Contracts\Handler
protected $handler;
* Creates a new instance of the Provider.
* @param \Whoops\RunInterface|null $run
* @param \NunoMaduro\Collision\Contracts\Handler|null $handler
public function __construct(RunInterface $run = null, HandlerContract $handler = null)
$this->run = $run ?: new Run;
$this->handler = $handler ?: new Handler;
}
* {@inheritdoc}
public function register(): ProviderContract
$this->run->pushHandler($this->handler)
$this->handler
object<NunoMaduro\Collision\Contracts\Handler>
callable
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);
->register();
return $this;
public function getHandler(): HandlerContract
return $this->handler;
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: