joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

Make file package tag optional #204

Closed mbabker closed 6 years ago

mbabker commented 7 years ago

As noted in #193 project wide we are at a state where repos and code are more dominantly in namespaces than not, so I think it's time to relax this requirement in the base coding standard.

For documentation purposes, our requirements should note that files containing non-namespaced classes (I think I would push it more toward that than a general "file without a namespace" statement as that affects procedural files like an index.php) should continue to require the tag and implementors create a custom ruleset (possibly a sniff too?) to enforce said requirement.

photodude commented 6 years ago

I suggest this should be in Version 3 of the code standard ruleset, Version 2 is highly tied to projects supporting PHP 5.3 where the Package tag would be required.

mbabker commented 6 years ago

Actually, it's really only required for project that's not using namespaced code (which is a PHP 5.3 feature). As long as we make it optional I'm not concerned about version, but it definitely need to stop requiring it sooner than later.

photodude commented 6 years ago

Ok, then this should be good to merge and move forward. We'll need to modify the Code standard guide to explicitly note it's optional in namespaced code.