| @@ 1512-1520 (lines=9) @@ | ||
| 1509 | * |
|
| 1510 | * @throws InvalidArgumentException |
|
| 1511 | */ |
|
| 1512 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1513 | { |
|
| 1514 | if (!\property_exists($classOrObject, $property)) { |
|
| 1515 | static::reportInvalidArgument(\sprintf( |
|
| 1516 | $message ?: 'Expected the property %s to exist.', |
|
| 1517 | static::valueToString($property) |
|
| 1518 | )); |
|
| 1519 | } |
|
| 1520 | } |
|
| 1521 | ||
| 1522 | /** |
|
| 1523 | * @param string|object $classOrObject |
|
| @@ 1529-1537 (lines=9) @@ | ||
| 1526 | * |
|
| 1527 | * @throws InvalidArgumentException |
|
| 1528 | */ |
|
| 1529 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1530 | { |
|
| 1531 | if (\property_exists($classOrObject, $property)) { |
|
| 1532 | static::reportInvalidArgument(\sprintf( |
|
| 1533 | $message ?: 'Expected the property %s to not exist.', |
|
| 1534 | static::valueToString($property) |
|
| 1535 | )); |
|
| 1536 | } |
|
| 1537 | } |
|
| 1538 | ||
| 1539 | /** |
|
| 1540 | * @param string|object $classOrObject |
|