@@ 1761-1769 (lines=9) @@ | ||
1758 | * |
|
1759 | * @throws InvalidArgumentException |
|
1760 | */ |
|
1761 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1762 | { |
|
1763 | if (!\property_exists($classOrObject, $property)) { |
|
1764 | static::reportInvalidArgument(\sprintf( |
|
1765 | $message ?: 'Expected the property %s to exist.', |
|
1766 | static::valueToString($property) |
|
1767 | )); |
|
1768 | } |
|
1769 | } |
|
1770 | ||
1771 | /** |
|
1772 | * @psalm-pure |
|
@@ 1781-1789 (lines=9) @@ | ||
1778 | * |
|
1779 | * @throws InvalidArgumentException |
|
1780 | */ |
|
1781 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1782 | { |
|
1783 | if (\property_exists($classOrObject, $property)) { |
|
1784 | static::reportInvalidArgument(\sprintf( |
|
1785 | $message ?: 'Expected the property %s to not exist.', |
|
1786 | static::valueToString($property) |
|
1787 | )); |
|
1788 | } |
|
1789 | } |
|
1790 | ||
1791 | /** |
|
1792 | * @psalm-pure |