Page MenuHomePhabricator

Enforce one class per file in preparation for PSR-4
Closed, ResolvedPublic

Description

MW-CS should enforce the one class per file requirement (there's an upstream sniff for this). This will be necessary in preparation for the PSR-4 namespaceization project.

Details

Related Gerrit Patches:

Event Timeline

Legoktm created this task.Aug 22 2017, 3:06 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 22 2017, 3:06 AM

Change 372916 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/codesniffer@master] Require only one class/interface/trait per file

https://gerrit.wikimedia.org/r/372916

Change 372916 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Require only one class/interface/trait per file

https://gerrit.wikimedia.org/r/372916

Legoktm closed this task as Resolved.Aug 23 2017, 6:18 AM
Legoktm reopened this task as Open.Aug 24 2017, 6:10 PM

Unfortunately this doesn't exactly do what we need. This enforces separately one class per file, one interface per file, etc. But it doesn't prevent a file from having one class and a interface in the same file.

Change 374026 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/tools/codesniffer@master] Use local OneClassPerFile sniff for only one class/interface/trait

https://gerrit.wikimedia.org/r/374026

Change 374026 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Use local OneClassPerFile sniff for only one class/interface/trait

https://gerrit.wikimedia.org/r/374026

Umherirrender closed this task as Resolved.Aug 27 2017, 10:51 AM
Umherirrender raised the priority of this task from Low to Medium.