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