In-Portal is out there for quite a long time and it doesn't really conform to any existing coding standard (e.g. PSR2 and such).
I think that:
- it's time to develop a Coding Standard
- find a way to automatically check for any standard violations
- make the "Custom" (Developer Kit) module comply to all standards
- update Unit Config Generator to produce only standard compliant code
I've create a list of replacements, that can be made in PhpStorm to at least start fixing the standards.
Replace This | With This | Is Regular Expression | Replace Options |
---|---|---|---|
Array ( | array( | no | case sensitive, match whole words |
array ( | array( | no | case sensitive, match whole words |
Array( | array( | no | case sensitive, match whole words |
(@param kEvent \$event)\n | $1 Event.\n | yes | case sensitive, match whole words |
[\t]+ \* @access protected\n | yes | ||
=> NULL | => null | no | case sensitive, match whole words |
\tclass | manually remove 1 indention level | ||
class (.*?) extends (.*?) \{ | class $1 extends $2\n\{ | yes | |
@param Array | @param array | no, but notice space at the end | |
* @param int | * @param integer | no, but notice space at the end | |
(\* @param array \$params)\n | $1 Tag params\.\n | yes | |
(// .*?[^\.])\n | $1.\n | yes |
P.S.
In fact I've developed a coding standard already, but it's not mature yet to be released.