| @@ 1640-1648 (lines=9) @@ | ||
| 1637 | * |
|
| 1638 | * @throws InvalidArgumentException |
|
| 1639 | */ |
|
| 1640 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1641 | { |
|
| 1642 | if (!\property_exists($classOrObject, $property)) { |
|
| 1643 | static::reportInvalidArgument(\sprintf( |
|
| 1644 | $message ?: 'Expected the property %s to exist.', |
|
| 1645 | static::valueToString($property) |
|
| 1646 | )); |
|
| 1647 | } |
|
| 1648 | } |
|
| 1649 | ||
| 1650 | /** |
|
| 1651 | * @psalm-pure |
|
| @@ 1660-1668 (lines=9) @@ | ||
| 1657 | * |
|
| 1658 | * @throws InvalidArgumentException |
|
| 1659 | */ |
|
| 1660 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1661 | { |
|
| 1662 | if (\property_exists($classOrObject, $property)) { |
|
| 1663 | static::reportInvalidArgument(\sprintf( |
|
| 1664 | $message ?: 'Expected the property %s to not exist.', |
|
| 1665 | static::valueToString($property) |
|
| 1666 | )); |
|
| 1667 | } |
|
| 1668 | } |
|
| 1669 | ||
| 1670 | /** |
|
| 1671 | * @psalm-pure |
|