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