for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Repository\Exceptions;
use Exception;
use Rinvex\Repository\Contracts\CriterionContract;
class CriterionException extends Exception
{
public static function wrongCriterionType($criterion)
$type = gettype($criterion);
$value = $type === 'object' ? get_class($criterion) : $criterion;
return new static('Given criterion with type '.$type.' and value '.$value.' is not allowed');
}
public static function classNotImplementContract($criterionClassName)
return new static('Given '.$criterionClassName.' class is not implement '.CriterionContract::class.'contract');
public static function wrongArraySignature(array $criterion)
return new static(
'Array signature for criterion instantiating must contain only two elements in case of sequential array and one in case of assoc array. '.
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.
'Array with length "'.count($criterion).'" given');
public static function missingPackage($methodName, $packageName)
return new static('Method '.$methodName.' is only available with "'.$packageName .'" package installed');
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.