Skip to content

Avoid PHP type deprecation on function call #6

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

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Feb 13, 2023

get's rid of

1) phpmock\integration\MockDelegateFunctionBuilderTest::testBuild
function_exists(): Passing null to parameter #1 ($function) of type string is deprecated

/Users/herndlm/Development/source/git-forks/php-mock-integration/tests/MockDelegateFunctionBuilderTest.php:23

2) phpmock\integration\MockDelegateFunctionTest::testDelegateReturnsMockResult
function_exists(): Passing null to parameter #1 ($function) of type string is deprecated

/Users/herndlm/Development/source/git-forks/php-mock-integration/tests/MockDelegateFunctionTest.php:38

3) phpmock\integration\MockDelegateFunctionTest::testDelegateForwardsArguments
function_exists(): Passing null to parameter #1 ($function) of type string is deprecated

/Users/herndlm/Development/source/git-forks/php-mock-integration/tests/MockDelegateFunctionTest.php:56

which comes from calling https://github.com/php-mock/php-mock/blob/2.4.0/classes/generator/ParameterBuilder.php#L32 with null. According to that PHPDoc this is invalid already anyways and static analysis would catch that.

@michalbundyra michalbundyra added this to the 2.2.1 milestone Feb 13, 2023
@michalbundyra michalbundyra merged commit 04f4a8d into php-mock:master Feb 13, 2023
@michalbundyra
Copy link
Member

Thanks, @herndlm !

@herndlm herndlm deleted the php-type-deprecation branch February 13, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants