Skip to content

Commit

Permalink
use davidlienhard/coding-standard (#31)
Browse files Browse the repository at this point in the history
use coding-standard for phpcs from `davidlienhard/coding-standard`
  • Loading branch information
davidlienhard committed Apr 11, 2021
1 parent 5089d52 commit 3314900
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 107 deletions.
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@
"issues": "https://github.com/davidlienhard/log/issues/",
"email": "david.lienhard@tourasia.ch"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.tourbase.ch"
}
],
"require": {
"php": "^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3",
"phpstan/phpstan": "^0"
"phpstan/phpstan": "^0",
"davidlienhard/coding-standard": "^0"
},
"autoload": {
"classmap": [
Expand Down
227 changes: 226 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 1 addition & 41 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,11 @@
<description>tourBase coding standard</description>

<!-- inherit rules -->
<rule ref="PSR2" />

<!-- force use of short array syntax ([ ])-->
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
<type>error</type>
</rule>

<!-- check whitespaces before and after operators -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
<type>error</type>
</rule>

<!-- disallow and & or, force && and || -->
<rule ref="Squiz.Operators.ValidLogicalOperators">
<type>error</type>
</rule>

<!-- require strict types to be set -->
<rule ref="Generic.PHP.RequireStrictTypes">
<type>error</type>
</rule>

<!-- extend line limit to 180 -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="180"/>
<property name="absoluteLineLimit" value="0"/>
</properties>
</rule>
<rule ref="DavidLienhard" />

<!-- Paths to check -->
<file>src</file>

<!-- dont display warnings -->
<arg name="warning-severity" value="0"/>

<!-- parse only php files -->
<arg name="extensions" value="php"/>

<!-- show process -->
<arg value="p"/>

<!-- folders / files to exclude -->
<exclude-pattern>vendor/*</exclude-pattern>
</ruleset>
Loading

0 comments on commit 3314900

Please sign in to comment.