assert icon indicating copy to clipboard operation
assert copied to clipboard

Assertion::classExists() emits a PHP Warning

Open ktomk opened this issue 2 years ago • 1 comments

asserting an expression with classExists(), and the expression is an array, it shows me the following warning:

PHP Warning: class_exists() expects parameter 1 to be string, array given in beberlei/assert/lib/Assert/Assertion.php on line 1860

on beberlei/assert v3.3.2 with php 7.4

and with php 8.0

PHP Fatal error: Uncaught TypeError: class_exists(): Argument #1 ( $class) must be of type string, array given in [...] Assertion.php:1860

add an is_string check.

ktomk avatar Jan 06 '22 13:01 ktomk

FYI had an issue following assert/CONTRIBUTING.md on master when filing this PR, see https://github.com/beberlei/assert/issues/321

ktomk avatar Jan 06 '22 14:01 ktomk