-
Notifications
You must be signed in to change notification settings - Fork 15
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: [PHPStan] $block_attributes
is always set
#90
fix: [PHPStan] $block_attributes
is always set
#90
Conversation
🦋 Changeset detectedLatest commit: 99ac818 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
$graphql_type = null; | ||
|
||
if ( ! isset( $attribute_config['type'] ) ) { | ||
return $block_attribute_fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this really be returning? My limited understanding of the code is that we want to continue
.
Beyond the scope of this PR, but I didnt know a better way to flag it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to
continue
I think you're right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @justlevine!
This PR fixes an issue in
Block::get_block_attributes_field()
, where the method was incorrectly checking if the paramater$block_attributes
was passed to the method (isset()
) instead of if the value passed wasnull
.The param signature has also been fixed and moved into PHP, to prevent errors like this from going unnoticed in the future.
Caught by PHPStan level 1.