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

Fix deprecation warning #1279

Closed
wants to merge 1 commit into from
Closed

Fix deprecation warning #1279

wants to merge 1 commit into from

Conversation

jdanino
Copy link

@jdanino jdanino commented Nov 29, 2021

Summary

Fixed a deprecation warning because of a nullable parameter to the reflection class constructor by adding and emtyp string as a default.

ReflectionClass::__construct(): Passing null to parameter #1 ($objectOrClass) of type object|string is deprecated

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@rrpadilla
Copy link

Hi @barryvdh, confirming this fixed the deprecation warning. Thanks.

ReflectionClass::__construct(): Passing null to parameter #1 ($objectOrClass) 
of type object|string is deprecated in 
/vendor/barryvdh/laravel-ide-helper/src/Console/MetaCommand.php on line 98

@barryvdh
Copy link
Owner

If it's null, it wouldn't make sense to try to make a reflection of it, right?

@mfn
Copy link
Collaborator

mfn commented Apr 18, 2022

Agreed, if the line above

$concrete = $this->laravel->make($abstract);

produces null in $concrete, something else is weird

@mfn
Copy link
Collaborator

mfn commented May 21, 2022

Superseded by #1351 which gives more details what's going on and does not silently coerce null into '', thank you though for this PR 🙏🏼

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.

4 participants