subclassOf() public static method

Assert that value is subclass of given class-name.
public static subclassOf ( mixed $value, string $className, string | null $message = null, string | null $propertyPath = null ) : boolean
$value mixed
$className string
$message string | null
$propertyPath string | null
return boolean
Beispiel #1
0
 public function testValidSubclassOf()
 {
     Assertion::subclassOf(new ChildStdClass(), 'stdClass');
 }
 private function assertExtendsEventSourcedAggregateRoot($class)
 {
     Assert::subclassOf($class, 'Broadway\\EventSourcing\\EventSourcedAggregateRoot', sprintf("Class '%s' is not an EventSourcedAggregateRoot.", $class));
 }