Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion::classExists() emits a PHP Warning #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ktomk
Copy link

@ktomk ktomk commented Jan 6, 2022

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.

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
Copy link
Author

ktomk commented Jan 6, 2022

FYI had an issue following assert/CONTRIBUTING.md on master when filing this PR, see #321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant