Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »

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:

  1. it's time to develop a Coding Standard
  2. find a way to automatically check for any standard violations
  3. make the "Custom" (Developer Kit) module comply to all standards
  4. 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 ThisWith ThisIs Regular ExpressionReplace Options
Array (array(nocase sensitive, match whole words
array (array(nocase sensitive, match whole words
Array(array(nocase sensitive, match whole words
(@param kEvent \$event)\n$1 Event.\nyescase sensitive, match whole words
[\t]+ \* @access protected\n yes 
=> NULL=> nullnocase sensitive, match whole words
\tclassmanually 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\.\nyes 
(// .*?[^\.])\n$1.\nyes, but manually check where a replacement is valid 

Class declaration

Another thing, that is fairly common is to apply 1 more extra TAB for class declaration indentation (see below). So it's commended to use Shift+TAB shortcut of PhpStorm to fix that instantly.

IncorrectCorrect
<?php
 
	class SomeClass {


	}
<?php
 
class SomeClass {
 
}

 

P.S.

In fact I've developed a coding standard already, but it's not mature yet to be released.

Related Tasks

  • No labels