| @@ 1712-1720 (lines=9) @@ | ||
| 1709 | * |
|
| 1710 | * @throws InvalidArgumentException |
|
| 1711 | */ |
|
| 1712 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1713 | { |
|
| 1714 | if (!\property_exists($classOrObject, $property)) { |
|
| 1715 | static::reportInvalidArgument(\sprintf( |
|
| 1716 | $message ?: 'Expected the property %s to exist.', |
|
| 1717 | static::valueToString($property) |
|
| 1718 | )); |
|
| 1719 | } |
|
| 1720 | } |
|
| 1721 | ||
| 1722 | /** |
|
| 1723 | * @psalm-pure |
|
| @@ 1732-1740 (lines=9) @@ | ||
| 1729 | * |
|
| 1730 | * @throws InvalidArgumentException |
|
| 1731 | */ |
|
| 1732 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1733 | { |
|
| 1734 | if (\property_exists($classOrObject, $property)) { |
|
| 1735 | static::reportInvalidArgument(\sprintf( |
|
| 1736 | $message ?: 'Expected the property %s to not exist.', |
|
| 1737 | static::valueToString($property) |
|
| 1738 | )); |
|
| 1739 | } |
|
| 1740 | } |
|
| 1741 | ||
| 1742 | /** |
|
| 1743 | * @psalm-pure |
|