@@ 416-425 (lines=10) @@ | ||
413 | )); |
|
414 | } |
|
415 | ||
416 | public static function isAOf($value, $class, $message = '') |
|
417 | { |
|
418 | if (!is_string($class) || !is_a($value, $class, is_string($value))) { |
|
419 | static::reportInvalidArgument(sprintf( |
|
420 | $message ?: 'Expected an instance of this class or to this class among his parents %2$s. Got: %s', |
|
421 | static::typeToString($value), |
|
422 | $class |
|
423 | )); |
|
424 | } |
|
425 | } |
|
426 | ||
427 | public static function notAOf($value, $class, $message = '') |
|
428 | { |
|
@@ 427-436 (lines=10) @@ | ||
424 | } |
|
425 | } |
|
426 | ||
427 | public static function notAOf($value, $class, $message = '') |
|
428 | { |
|
429 | if (!is_string($class) || is_a($value, $class, is_string($value))) { |
|
430 | static::reportInvalidArgument(sprintf( |
|
431 | $message ?: 'Expected an instance of this class or to this class among his parents other than %2$s. Got: %s', |
|
432 | static::typeToString($value), |
|
433 | $class |
|
434 | )); |
|
435 | } |
|
436 | } |
|
437 | ||
438 | public static function isAOfAny($value, array $classes, $message = '') |
|
439 | { |