-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from openeuropa/tighten-coding-standards
- Loading branch information
Showing
43 changed files
with
320 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?xml version="1.0"?> | ||
<!-- PHP_CodeSniffer ruleset for TaskRunner. --> | ||
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php --> | ||
<ruleset name="TaskRunner"> | ||
<description>TaskRunner coding standard</description> | ||
|
||
<!-- Include the Slevomat sniffs. --> | ||
<rule ref="./vendor/squizlabs/php_codesniffer/src/Standards/PSR12" /> | ||
<config name="installed_paths" value="../../slevomat/coding-standard"/> | ||
|
||
<!-- Exclude unsupported file types. --> | ||
<exclude-pattern>*.gif</exclude-pattern> | ||
<exclude-pattern>*.less</exclude-pattern> | ||
<exclude-pattern>*.png</exclude-pattern> | ||
|
||
<!-- Minified files don't have to comply with coding standards. --> | ||
<exclude-pattern>*.min.css</exclude-pattern> | ||
<exclude-pattern>*.min.js</exclude-pattern> | ||
|
||
<!-- Require classes to be documented using docblock comments. --> | ||
<rule ref="PEAR.Commenting.ClassComment.Missing"/> | ||
<rule ref="PEAR.Commenting.ClassComment.WrongStyle"/> | ||
<rule ref="Squiz.CSS.EmptyClassDefinition"/> | ||
|
||
<!-- Require the strict types declaration in every PHP file. --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"> | ||
<properties> | ||
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/> | ||
<property name="spacesCountAroundEqualsSign" value="0"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Detect unused use statements. --> | ||
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/> | ||
|
||
<!-- Require nullable types to be preceded by the nullability symbol. --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/> | ||
|
||
<!-- Forbid obsolete annotations which are superseded by annotations and version control. --> | ||
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"> | ||
<properties> | ||
<property name="forbiddenAnnotations" type="array"> | ||
<element value="@author"/> | ||
<element value="@created"/> | ||
<element value="@copyright"/> | ||
<element value="@license"/> | ||
<element value="@package"/> | ||
<element value="@version"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Forbid unhelpful documentation auto-generated by IDEs. --> | ||
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments"> | ||
<properties> | ||
<property name="forbiddenCommentPatterns" type="array"> | ||
<element value="/^Class [a-zA-z]*\.?$/"/> | ||
<element value="/^Interface [a-zA-z]*\.?$/"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Enforce correct formatting of type hints for return types. --> | ||
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/> | ||
|
||
<!-- Use statements should be ordered alphabetically. --> | ||
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"> | ||
<properties> | ||
<property name="caseSensitive" value="true"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- The concatenation operator should be surrounded with a space. --> | ||
<rule ref="Squiz.Strings.ConcatenationSpacing"> | ||
<properties> | ||
<property name="spacing" value="1"/> | ||
<property name="ignoreNewlines" value="true"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="task-runner"> | ||
<description>PHP CodeSniffer configuration for TaskRunner.</description> | ||
<rule ref="phpcs-ruleset.xml"/> | ||
<file>src</file> | ||
<file>tests</file> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenEuropa\TaskRunner\Commands; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OpenEuropa\TaskRunner\Commands; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.