for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Version package.
*
* Copyright (c) Nikola Posa <[email protected]>
* For full copyright and license information, please refer to the LICENSE file,
* located at the package root folder.
*/
namespace Version\Exception;
use DomainException;
use Version\Constraint\ConstraintInterface;
* @author Nikola Posa <[email protected]>
class InvalidCompositeConstraintException extends DomainException implements Exception
{
public static function forType($type)
return new self(sprintf('Unsupported type: %s', $type));
}
public static function forConstraint($constraint)
return new self(sprintf(
'Constraints should be %s instances; %s given',
ConstraintInterface::class,
is_object($constraint) ? get_class($constraint) : gettype($constraint)
));