|
@@ 1640-1648 (lines=9) @@
|
| 1637 |
|
* |
| 1638 |
|
* @throws InvalidArgumentException |
| 1639 |
|
*/ |
| 1640 |
|
public static function methodExists($classOrObject, $method, $message = '') |
| 1641 |
|
{ |
| 1642 |
|
if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) { |
| 1643 |
|
static::reportInvalidArgument(\sprintf( |
| 1644 |
|
$message ?: 'Expected the method %s to exist.', |
| 1645 |
|
static::valueToString($method) |
| 1646 |
|
)); |
| 1647 |
|
} |
| 1648 |
|
} |
| 1649 |
|
|
| 1650 |
|
/** |
| 1651 |
|
* @psalm-pure |
|
@@ 1660-1668 (lines=9) @@
|
| 1657 |
|
* |
| 1658 |
|
* @throws InvalidArgumentException |
| 1659 |
|
*/ |
| 1660 |
|
public static function methodNotExists($classOrObject, $method, $message = '') |
| 1661 |
|
{ |
| 1662 |
|
if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) { |
| 1663 |
|
static::reportInvalidArgument(\sprintf( |
| 1664 |
|
$message ?: 'Expected the method %s to not exist.', |
| 1665 |
|
static::valueToString($method) |
| 1666 |
|
)); |
| 1667 |
|
} |
| 1668 |
|
} |
| 1669 |
|
|
| 1670 |
|
/** |
| 1671 |
|
* @psalm-pure |