Файл: vendor/nunomaduro/collision/src/Provider.php
Строк: 77
<?php
declare(strict_types=1);
namespace NunoMaduroCollision;
use NunoMaduroCollisionContractsHandler as HandlerContract;
use NunoMaduroCollisionContractsProvider as ProviderContract;
use WhoopsRun;
use WhoopsRunInterface;
/**
* @internal
*
* @see TestsUnitProviderTest
*/
final class Provider implements ProviderContract
{
/**
* Holds an instance of the Run.
*
* @var WhoopsRunInterface
*/
protected $run;
/**
* Holds an instance of the handler.
*
* @var NunoMaduroCollisionContractsHandler
*/
protected $handler;
/**
* Creates a new instance of the Provider.
*/
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)
->register();
return $this;
}
/**
* {@inheritdoc}
*/
public function getHandler(): HandlerContract
{
return $this->handler;
}
}