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