| @@ 1801-1809 (lines=9) @@ | ||
| 1798 | * |
|
| 1799 | * @throws InvalidArgumentException |
|
| 1800 | */ |
|
| 1801 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1802 | { |
|
| 1803 | if (!\property_exists($classOrObject, $property)) { |
|
| 1804 | static::reportInvalidArgument(\sprintf( |
|
| 1805 | $message ?: 'Expected the property %s to exist.', |
|
| 1806 | static::valueToString($property) |
|
| 1807 | )); |
|
| 1808 | } |
|
| 1809 | } |
|
| 1810 | ||
| 1811 | /** |
|
| 1812 | * @psalm-pure |
|
| @@ 1821-1829 (lines=9) @@ | ||
| 1818 | * |
|
| 1819 | * @throws InvalidArgumentException |
|
| 1820 | */ |
|
| 1821 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1822 | { |
|
| 1823 | if (\property_exists($classOrObject, $property)) { |
|
| 1824 | static::reportInvalidArgument(\sprintf( |
|
| 1825 | $message ?: 'Expected the property %s to not exist.', |
|
| 1826 | static::valueToString($property) |
|
| 1827 | )); |
|
| 1828 | } |
|
| 1829 | } |
|
| 1830 | ||
| 1831 | /** |
|
| 1832 | * @psalm-pure |
|