| @@ 1584-1592 (lines=9) @@ | ||
| 1581 | * |
|
| 1582 | * @throws InvalidArgumentException |
|
| 1583 | */ |
|
| 1584 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1585 | { |
|
| 1586 | if (!\property_exists($classOrObject, $property)) { |
|
| 1587 | static::reportInvalidArgument(\sprintf( |
|
| 1588 | $message ?: 'Expected the property %s to exist.', |
|
| 1589 | static::valueToString($property) |
|
| 1590 | )); |
|
| 1591 | } |
|
| 1592 | } |
|
| 1593 | ||
| 1594 | /** |
|
| 1595 | * @param string|object $classOrObject |
|
| @@ 1601-1609 (lines=9) @@ | ||
| 1598 | * |
|
| 1599 | * @throws InvalidArgumentException |
|
| 1600 | */ |
|
| 1601 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1602 | { |
|
| 1603 | if (\property_exists($classOrObject, $property)) { |
|
| 1604 | static::reportInvalidArgument(\sprintf( |
|
| 1605 | $message ?: 'Expected the property %s to not exist.', |
|
| 1606 | static::valueToString($property) |
|
| 1607 | )); |
|
| 1608 | } |
|
| 1609 | } |
|
| 1610 | ||
| 1611 | /** |
|
| 1612 | * @param string|object $classOrObject |
|