|
@@ 1680-1688 (lines=9) @@
|
| 1677 |
|
* |
| 1678 |
|
* @throws InvalidArgumentException |
| 1679 |
|
*/ |
| 1680 |
|
public static function methodExists($classOrObject, $method, $message = '') |
| 1681 |
|
{ |
| 1682 |
|
if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) { |
| 1683 |
|
static::reportInvalidArgument(\sprintf( |
| 1684 |
|
$message ?: 'Expected the method %s to exist.', |
| 1685 |
|
static::valueToString($method) |
| 1686 |
|
)); |
| 1687 |
|
} |
| 1688 |
|
} |
| 1689 |
|
|
| 1690 |
|
/** |
| 1691 |
|
* @psalm-pure |
|
@@ 1700-1708 (lines=9) @@
|
| 1697 |
|
* |
| 1698 |
|
* @throws InvalidArgumentException |
| 1699 |
|
*/ |
| 1700 |
|
public static function methodNotExists($classOrObject, $method, $message = '') |
| 1701 |
|
{ |
| 1702 |
|
if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) { |
| 1703 |
|
static::reportInvalidArgument(\sprintf( |
| 1704 |
|
$message ?: 'Expected the method %s to not exist.', |
| 1705 |
|
static::valueToString($method) |
| 1706 |
|
)); |
| 1707 |
|
} |
| 1708 |
|
} |
| 1709 |
|
|
| 1710 |
|
/** |
| 1711 |
|
* @psalm-pure |