File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -361,8 +361,8 @@ public function analyze(
361361 $ context ->external_mutation_free = true ;
362362 }
363363
364- if ($ storage ->unused_docblock_params ) {
365- foreach ($ storage ->unused_docblock_params as $ param_name => $ param_location ) {
364+ if ($ storage ->has_undertyped_native_parameters ) {
365+ foreach ($ storage ->unused_docblock_parameters as $ param_name => $ param_location ) {
366366 IssueBuffer::maybeAdd (
367367 new InvalidDocblockParamName (
368368 'Incorrect param name $ ' . $ param_name . ' in docblock for ' . $ cased_method_id ,
Original file line number Diff line number Diff line change @@ -908,8 +908,12 @@ private static function improveParamsFromDocblock(
908908 );
909909
910910 if ($ params_without_docblock_type ) {
911+ /** @psalm-suppress DeprecatedProperty remove in Psalm 6 */
911912 $ storage ->unused_docblock_params = $ unused_docblock_params ;
912913 }
914+
915+ $ storage ->has_undertyped_native_parameters = $ params_without_docblock_type !== [];
916+ $ storage ->unused_docblock_parameters = $ unused_docblock_params ;
913917 }
914918
915919 /**
Original file line number Diff line number Diff line change @@ -172,10 +172,19 @@ abstract class FunctionLikeStorage implements HasAttributesInterface
172172 public $ return_type_description ;
173173
174174 /**
175+ * @psalm-suppress PossiblyUnusedProperty
175176 * @var array<string, CodeLocation>|null
177+ * @deprecated will be removed in Psalm 6. use {@see FunctionLikeStorage::$unused_docblock_parameters} instead
176178 */
177179 public $ unused_docblock_params ;
178180
181+ /**
182+ * @var array<string, CodeLocation>
183+ */
184+ public array $ unused_docblock_parameters = [];
185+
186+ public bool $ has_undertyped_native_parameters = false ;
187+
179188 /**
180189 * @var bool
181190 */
You can’t perform that action at this time.
0 commit comments