| @@ 1738-1746 (lines=9) @@ | ||
| 1735 | * |
|
| 1736 | * @throws InvalidArgumentException |
|
| 1737 | */ |
|
| 1738 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1739 | { |
|
| 1740 | if (!\property_exists($classOrObject, $property)) { |
|
| 1741 | static::reportInvalidArgument(\sprintf( |
|
| 1742 | $message ?: 'Expected the property %s to exist.', |
|
| 1743 | static::valueToString($property) |
|
| 1744 | )); |
|
| 1745 | } |
|
| 1746 | } |
|
| 1747 | ||
| 1748 | /** |
|
| 1749 | * @psalm-pure |
|
| @@ 1758-1766 (lines=9) @@ | ||
| 1755 | * |
|
| 1756 | * @throws InvalidArgumentException |
|
| 1757 | */ |
|
| 1758 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1759 | { |
|
| 1760 | if (\property_exists($classOrObject, $property)) { |
|
| 1761 | static::reportInvalidArgument(\sprintf( |
|
| 1762 | $message ?: 'Expected the property %s to not exist.', |
|
| 1763 | static::valueToString($property) |
|
| 1764 | )); |
|
| 1765 | } |
|
| 1766 | } |
|
| 1767 | ||
| 1768 | /** |
|
| 1769 | * @psalm-pure |
|