Equip\Exception\ResponderException::invalidClass PHP Method

invalidClass() public static method

public static invalidClass ( string $spec ) : static
$spec string
return static
    public static function invalidClass($spec)
    {
        return new static(sprintf('Responder class `%s` must implement `%s`', $spec, ResponderInterface::class));
    }

Usage Example

Esempio n. 1
0
 /**
  * @inheritDoc
  *
  * @throws ResponderException
  *  If $classes does not implement the correct interface.
  */
 protected function assertValid(array $classes)
 {
     parent::assertValid($classes);
     foreach ($classes as $responder) {
         if (!is_subclass_of($responder, ResponderInterface::class)) {
             throw ResponderException::invalidClass($responder);
         }
     }
 }
ResponderException