[.travis.yml][phpcs.xml] Introduce TravisCI + PHP_CodeSniffer

This commit is contained in:
logmanoriginal 2016-08-26 17:21:39 +02:00
parent 73ec10f9ca
commit 449b2ca520
2 changed files with 71 additions and 0 deletions

15
.travis.yml Normal file
View file

@ -0,0 +1,15 @@
language: php
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- hhvm
- nightly
install:
- pear install PHP_CodeSniffer
script:
- phpenv rehash
- phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p

56
phpcs.xml Normal file
View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="RSS-Bridge Ruleset">
<description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/</description>
<exclude-pattern>./bridges</exclude-pattern>
<exclude-pattern>./css</exclude-pattern>
<exclude-pattern>./vendor</exclude-pattern>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="80"/>
<property name="absoluteLineLimit" value="120"/>
</properties>
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PEAR.NamingConventions.ValidClassName"/>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
<properties>
<property name="indent" value="2"/>
</properties>
</rule>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
</ruleset>