@@ 1641-1649 (lines=9) @@ | ||
1638 | * |
|
1639 | * @throws InvalidArgumentException |
|
1640 | */ |
|
1641 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1642 | { |
|
1643 | if (!\property_exists($classOrObject, $property)) { |
|
1644 | static::reportInvalidArgument(\sprintf( |
|
1645 | $message ?: 'Expected the property %s to exist.', |
|
1646 | static::valueToString($property) |
|
1647 | )); |
|
1648 | } |
|
1649 | } |
|
1650 | ||
1651 | /** |
|
1652 | * @psalm-pure |
|
@@ 1661-1669 (lines=9) @@ | ||
1658 | * |
|
1659 | * @throws InvalidArgumentException |
|
1660 | */ |
|
1661 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1662 | { |
|
1663 | if (\property_exists($classOrObject, $property)) { |
|
1664 | static::reportInvalidArgument(\sprintf( |
|
1665 | $message ?: 'Expected the property %s to not exist.', |
|
1666 | static::valueToString($property) |
|
1667 | )); |
|
1668 | } |
|
1669 | } |
|
1670 | ||
1671 | /** |
|
1672 | * @psalm-pure |