Server : LiteSpeed System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : cardxfeb ( 2452) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/cardxfeb/public_html/vendor/nunomaduro/collision/src/ |
<?php
declare(strict_types=1);
namespace NunoMaduro\Collision;
use Whoops\Run;
use Whoops\RunInterface;
/**
* @internal
*
* @see \Tests\Unit\ProviderTest
*/
final class Provider
{
/**
* Holds an instance of the Run.
*/
private RunInterface $run;
/**
* Holds an instance of the handler.
*/
private Handler $handler;
/**
* Creates a new instance of the Provider.
*/
public function __construct(RunInterface $run = null, Handler $handler = null)
{
$this->run = $run ?: new Run();
$this->handler = $handler ?: new Handler();
}
/**
* Registers the current Handler as Error Handler.
*/
public function register(): self
{
$this->run->pushHandler($this->handler)
->register();
return $this;
}
/**
* Returns the handler.
*/
public function getHandler(): Handler
{
return $this->handler;
}
}