Conversation
| </rule> | ||
| <rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> | ||
| <properties> | ||
| <property name="rootNamespaces" type="array"> |
There was a problem hiding this comment.
@dereuromark Do you have a sniff which auto reads the PSR-4 mapping in composer.json and avoid having to do this manual mapping? 🙂
There was a problem hiding this comment.
Yes, PhpCollective.Classes.Psr4 already does that. It reads the PSR-4 mappings from composer.json automatically, including both autoload.psr-4 and autoload-dev.psr-4, so there is no need to maintain the namespace map manually. It also supports composerJsonPath in case the file is not at the default location.
- PhpCollective/Sniffs/Classes/Psr4Sniff.php:47
- PhpCollective/Sniffs/Classes/Psr4/AutoloadabilityInspectorsFactory.php:62
There was a problem hiding this comment.
Great, so I guess the question is whether we want to copy that sniff into Cake's codesniffer repo or add php-collective/code-sniffer as a dependency.
There was a problem hiding this comment.
I guess the copy might be simpler :)
There was a problem hiding this comment.
Copying with attribution is fine.
No description provided.