@@ 1619-1627 (lines=9) @@ | ||
1616 | * |
|
1617 | * @throws InvalidArgumentException |
|
1618 | */ |
|
1619 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1620 | { |
|
1621 | if (!\property_exists($classOrObject, $property)) { |
|
1622 | static::reportInvalidArgument(\sprintf( |
|
1623 | $message ?: 'Expected the property %s to exist.', |
|
1624 | static::valueToString($property) |
|
1625 | )); |
|
1626 | } |
|
1627 | } |
|
1628 | ||
1629 | /** |
|
1630 | * @psalm-pure |
|
@@ 1639-1647 (lines=9) @@ | ||
1636 | * |
|
1637 | * @throws InvalidArgumentException |
|
1638 | */ |
|
1639 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1640 | { |
|
1641 | if (\property_exists($classOrObject, $property)) { |
|
1642 | static::reportInvalidArgument(\sprintf( |
|
1643 | $message ?: 'Expected the property %s to not exist.', |
|
1644 | static::valueToString($property) |
|
1645 | )); |
|
1646 | } |
|
1647 | } |
|
1648 | ||
1649 | /** |
|
1650 | * @psalm-pure |