| @@ 1798-1806 (lines=9) @@ | ||
| 1795 | * |
|
| 1796 | * @throws InvalidArgumentException |
|
| 1797 | */ |
|
| 1798 | public static function methodExists($classOrObject, $method, $message = '') |
|
| 1799 | { |
|
| 1800 | if (!\method_exists($classOrObject, $method)) { |
|
| 1801 | static::reportInvalidArgument(\sprintf( |
|
| 1802 | $message ?: 'Expected the method %s to exist.', |
|
| 1803 | static::valueToString($method) |
|
| 1804 | )); |
|
| 1805 | } |
|
| 1806 | } |
|
| 1807 | ||
| 1808 | /** |
|
| 1809 | * @psalm-pure |
|
| @@ 1818-1826 (lines=9) @@ | ||
| 1815 | * |
|
| 1816 | * @throws InvalidArgumentException |
|
| 1817 | */ |
|
| 1818 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
| 1819 | { |
|
| 1820 | if (\method_exists($classOrObject, $method)) { |
|
| 1821 | static::reportInvalidArgument(\sprintf( |
|
| 1822 | $message ?: 'Expected the method %s to not exist.', |
|
| 1823 | static::valueToString($method) |
|
| 1824 | )); |
|
| 1825 | } |
|
| 1826 | } |
|
| 1827 | ||
| 1828 | /** |
|
| 1829 | * @psalm-pure |
|