for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Wandu\DI\Exception;
use Psr\Container\NotFoundExceptionInterface;
use RuntimeException;
class RequirePackageException extends RuntimeException implements NotFoundExceptionInterface
{
/** @var string */
protected $class;
protected $package;
/**
* @param string $class
* @param string $package
*/
public function __construct($class, $package)
$traces = debug_backtrace();
$this->message = "cannot find the \"{$class}\" class, install \"{$package}\" package.";
$this->package = $package;
if (isset($traces[1])) {
$this->file = $traces[1]['file'];
$this->line = $traces[1]['line'];
}
* @return string
public function getClass()
return $this->class;
public function getPackage()
return $this->package;