for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cycle\Schema\Provider\Exception;
class BadDeclarationException extends \Exception
{
/**
* @param non-empty-string $parameter
non-empty-string
0
* @param class-string $class
*/
public function __construct(string $parameter, string $class, mixed $argument)
$type = \is_object($argument)
? 'Instance of ' . \get_class($argument)
: \ucfirst(\get_debug_type($argument));
parent::__construct(\sprintf(
'%s should be instance of %s or its declaration. %s was received instead.',
$parameter,
$class,
$type
));
}