We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cms/src/behaviors/CustomFieldBehavior.php.template
Lines 31 to 34 in c51f730
the type annotation string[] is wrong here. What gets generated is a bool[] or more specifically an array<string,bool>:
string[]
bool[]
array<string,bool>
public static $fieldHandles = [ 'field1' => true, 'field2' => true, 'field3' => true, ];
PHPStan (level 5) trips over this.
A stub file like this
<?php namespace craft\behaviors; class CustomFieldBehavior { /** * @var array<string,bool> */ public static $fieldHandles = []; }
fixes this but you might just want to use the correct type annotation in the first place so this stub is not necessary anymore.
4.7.3
No response
The text was updated successfully, but these errors were encountered:
24418be
Thanks for pointing that out! Fixed for the next release.
Sorry, something went wrong.
Craft 4.7.4 is out with that fix. Note you’ll need to run php craft clear-caches/compiled-classes to regenerate CustomFieldBehavior.
php craft clear-caches/compiled-classes
CustomFieldBehavior
No branches or pull requests
What happened?
Description
cms/src/behaviors/CustomFieldBehavior.php.template
Lines 31 to 34 in c51f730
the type annotation
string[]
is wrong here. What gets generated is abool[]
or more specifically anarray<string,bool>
:PHPStan (level 5) trips over this.
A stub file like this
fixes this but you might just want to use the correct type annotation in the first place so this stub is not necessary anymore.
Craft CMS version
4.7.3
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: