@@ 1694-1702 (lines=9) @@ | ||
1691 | * |
|
1692 | * @throws InvalidArgumentException |
|
1693 | */ |
|
1694 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1695 | { |
|
1696 | if (!\property_exists($classOrObject, $property)) { |
|
1697 | static::reportInvalidArgument(\sprintf( |
|
1698 | $message ?: 'Expected the property %s to exist.', |
|
1699 | static::valueToString($property) |
|
1700 | )); |
|
1701 | } |
|
1702 | } |
|
1703 | ||
1704 | /** |
|
1705 | * @psalm-pure |
|
@@ 1714-1722 (lines=9) @@ | ||
1711 | * |
|
1712 | * @throws InvalidArgumentException |
|
1713 | */ |
|
1714 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1715 | { |
|
1716 | if (\property_exists($classOrObject, $property)) { |
|
1717 | static::reportInvalidArgument(\sprintf( |
|
1718 | $message ?: 'Expected the property %s to not exist.', |
|
1719 | static::valueToString($property) |
|
1720 | )); |
|
1721 | } |
|
1722 | } |
|
1723 | ||
1724 | /** |
|
1725 | * @psalm-pure |