Commit graph

12 commits

Author SHA1 Message Date
logmanoriginal
ce65f51d91 [phpcs] Fix blank line detection
Squiz.WhiteSpace.SuperfluousWhitespace has problems detecting blank
lines in functions when used together with the PSR2 standard.

More information: https://github.com/squizlabs/PHP_CodeSniffer/issues/600

This commit fixes that issue by restoring the original behavior.
It also adds rules for function spacing because the sniff mentioned
above does only work within functions.
2018-12-26 21:39:37 +01:00
logmanoriginal
c296e73c18 [phpcs] Add rules for method declarations in classes 2018-11-13 18:25:37 +01:00
logmanoriginal
e295dc5a79 [phpcs] Add check for concatenation operator spacing
The concatenation operator should have one space before and after
2018-11-05 12:52:18 +01:00
LogMANOriginal
193ca87afa [phpcs] enforce single quotes (#732)
* [phpcs] Add rule to enforce single quoted strings
2018-06-29 22:55:33 +01:00
logmanoriginal
a4b9611e66 [phpcs] Add missing rules
- Do not add spaces after opening or before closing parenthesis

  // Wrong
  if( !is_null($var) ) {
    ...
  }

  // Right
  if(!is_null($var)) {
    ...
  }

- Add space after closing parenthesis

  // Wrong
  if(true){
    ...
  }

  // Right
  if(true) {
    ...
  }

- Add body into new line
- Close body in new line

  // Wrong
  if(true) { ... }

  // Right
  if(true) {
    ...
  }

Notice: Spaces after keywords are not detected:

  // Wrong (not detected)
  // -> space after 'if' and missing space after 'else'
  if (true) {
    ...
  } else{
    ...
  }

  // Right
  if(true) {
    ...
  } else {
    ...
  }
2017-07-29 19:55:12 +02:00
Teromene
1a4c3f4418 Add a search bar to simplify looking for a bridge. (#494)
* Add a search bar to simplify looking for a bridge.

* Fix phpcs line length.

* Change the phpcs config.
2017-03-21 20:31:10 +00:00
logmanoriginal
d8f5aa3c79 [phpcs] Add sniffs for function declaration and -calls
When declaring a function
- Do not add a space before a comma
- Add a space after a comma
- Add a space after an equal sign

Example:
function myFunction($x, $y, $z = null){...}

When calling a function
- Do not add a space before the opening parenthesis
- Do not add a space after the opening parenthesis
- Do not add a space before the closing parenthesis
- Do not add a space before a comma
- Add a space after a comma

Example:
myFunction('x', 'y', 'z');
2017-02-14 17:03:05 +01:00
logmanoriginal
23430f1c07 [phpcs] Add documentation 2017-02-14 16:50:34 +01:00
logmanoriginal
22a7666d2b [phpcs] Include bridges for coding style checks 2017-02-12 15:34:08 +01:00
logmanoriginal
e3392a738b [phpcs] Remove check for Zend OperatorSpacing
This check is not helping as code is quite readable
2016-09-10 21:05:29 +02:00
logmanoriginal
32ce2b6541 [phpcs] Update checks
- Use tabs for indentation
2016-09-10 19:55:49 +02:00
logmanoriginal
449b2ca520 [.travis.yml][phpcs.xml] Introduce TravisCI + PHP_CodeSniffer 2016-08-26 19:01:11 +02:00