Closed (duplicate)
Project:
Drupal core
Version:
10.0.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2022 at 12:14 UTC
Updated:
20 Nov 2022 at 14:02 UTC
Jump to comment: Most recent
Comments
Comment #3
longwaveIs there no PHPCS or Coder sniff for this?
Comment #4
spokjeApparently not...
One of them was caught by PHPStan Level 0, but that's about it.
Comment #5
longwaveAlso is this a dupe of your own issue? :) #3226198: [PP-1] Undefined namespaces in PHP DocBlocks
Comment #6
spokjeHmmm, I _knew_ I did something similar, but couldn't find it again.
It's not _exactly_ the same, but very close. Unsure if I should close the original one, since that's very out of date by now.
Also, as said in the IS, I don't _think_ we need to wait for a Rule in Coder, since it will be caught by PHPStan at some point/level.
Fixing some/most of them now improves DX IMHO.
Comment #7
spokjeComment #8
mondrakeIt's a pity that the coding standards say
(even though I can't google that, I only see that referred in #3250534: @param tags not using a fully-qualified class names are not reported)
That's limiting readibility IMHO. Other packages use the
usestatements to import the FQCNs, and their PHPDoc only refer to the class name. PHPStan fully supports that.So something like this
would become something like this
that is, BTW, also what would happen once the property will be typehinted instead of annotated.
Comment #9
spokjeComment #10
spokjeWill be fixed in #3322743: Fix PHPStan L2 errors "Parameter $foo of method Foo::bar() has invalid type Foo\Baz." and "Method Foo::bar() has invalid return type Foo\Baz. "