@@ 1600-1608 (lines=9) @@ | ||
1597 | * |
|
1598 | * @throws InvalidArgumentException |
|
1599 | */ |
|
1600 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1601 | { |
|
1602 | if (!\property_exists($classOrObject, $property)) { |
|
1603 | static::reportInvalidArgument(\sprintf( |
|
1604 | $message ?: 'Expected the property %s to exist.', |
|
1605 | static::valueToString($property) |
|
1606 | )); |
|
1607 | } |
|
1608 | } |
|
1609 | ||
1610 | /** |
|
1611 | * @psalm-pure |
|
@@ 1620-1628 (lines=9) @@ | ||
1617 | * |
|
1618 | * @throws InvalidArgumentException |
|
1619 | */ |
|
1620 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1621 | { |
|
1622 | if (\property_exists($classOrObject, $property)) { |
|
1623 | static::reportInvalidArgument(\sprintf( |
|
1624 | $message ?: 'Expected the property %s to not exist.', |
|
1625 | static::valueToString($property) |
|
1626 | )); |
|
1627 | } |
|
1628 | } |
|
1629 | ||
1630 | /** |
|
1631 | * @psalm-pure |