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