@@ 1504-1512 (lines=9) @@ | ||
1501 | * |
|
1502 | * @throws InvalidArgumentException |
|
1503 | */ |
|
1504 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1505 | { |
|
1506 | if (!\property_exists($classOrObject, $property)) { |
|
1507 | static::reportInvalidArgument(\sprintf( |
|
1508 | $message ?: 'Expected the property %s to exist.', |
|
1509 | static::valueToString($property) |
|
1510 | )); |
|
1511 | } |
|
1512 | } |
|
1513 | ||
1514 | /** |
|
1515 | * @param string|object $classOrObject |
|
@@ 1521-1529 (lines=9) @@ | ||
1518 | * |
|
1519 | * @throws InvalidArgumentException |
|
1520 | */ |
|
1521 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1522 | { |
|
1523 | if (\property_exists($classOrObject, $property)) { |
|
1524 | static::reportInvalidArgument(\sprintf( |
|
1525 | $message ?: 'Expected the property %s to not exist.', |
|
1526 | static::valueToString($property) |
|
1527 | )); |
|
1528 | } |
|
1529 | } |
|
1530 | ||
1531 | /** |
|
1532 | * @param string|object $classOrObject |