@@ 1542-1550 (lines=9) @@ | ||
1539 | * |
|
1540 | * @throws InvalidArgumentException |
|
1541 | */ |
|
1542 | public static function propertyExists($classOrObject, $property, $message = '') |
|
1543 | { |
|
1544 | if (!\property_exists($classOrObject, $property)) { |
|
1545 | static::reportInvalidArgument(\sprintf( |
|
1546 | $message ?: 'Expected the property %s to exist.', |
|
1547 | static::valueToString($property) |
|
1548 | )); |
|
1549 | } |
|
1550 | } |
|
1551 | ||
1552 | /** |
|
1553 | * @psalm-param class-string|object $classOrObject |
|
@@ 1561-1569 (lines=9) @@ | ||
1558 | * |
|
1559 | * @throws InvalidArgumentException |
|
1560 | */ |
|
1561 | public static function propertyNotExists($classOrObject, $property, $message = '') |
|
1562 | { |
|
1563 | if (\property_exists($classOrObject, $property)) { |
|
1564 | static::reportInvalidArgument(\sprintf( |
|
1565 | $message ?: 'Expected the property %s to not exist.', |
|
1566 | static::valueToString($property) |
|
1567 | )); |
|
1568 | } |
|
1569 | } |
|
1570 | ||
1571 | /** |
|
1572 | * @psalm-param class-string|object $classOrObject |