| @@ 1781-1789 (lines=9) @@ | ||
| 1778 | * |
|
| 1779 | * @throws InvalidArgumentException |
|
| 1780 | */ |
|
| 1781 | public static function propertyExists($classOrObject, $property, $message = '') |
|
| 1782 | { |
|
| 1783 | if (!\property_exists($classOrObject, $property)) { |
|
| 1784 | static::reportInvalidArgument(\sprintf( |
|
| 1785 | $message ?: 'Expected the property %s to exist.', |
|
| 1786 | static::valueToString($property) |
|
| 1787 | )); |
|
| 1788 | } |
|
| 1789 | } |
|
| 1790 | ||
| 1791 | /** |
|
| 1792 | * @psalm-pure |
|
| @@ 1801-1809 (lines=9) @@ | ||
| 1798 | * |
|
| 1799 | * @throws InvalidArgumentException |
|
| 1800 | */ |
|
| 1801 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
| 1802 | { |
|
| 1803 | if (\property_exists($classOrObject, $property)) { |
|
| 1804 | static::reportInvalidArgument(\sprintf( |
|
| 1805 | $message ?: 'Expected the property %s to not exist.', |
|
| 1806 | static::valueToString($property) |
|
| 1807 | )); |
|
| 1808 | } |
|
| 1809 | } |
|
| 1810 | ||
| 1811 | /** |
|
| 1812 | * @psalm-pure |
|