Skip to content

Commit

Permalink
test: test config
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed May 8, 2024
1 parent e850ebd commit d056bef
Showing 3 changed files with 133 additions and 0 deletions.
61 changes: 61 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?xml version="1.0"?>
<ruleset name="PHP.Gt Standard" namespace="Gt\CS\Standard">
<description>Created from PHP.Gt/Styleguide</description>
<arg name="extensions" value="php" />

<rule ref="Generic.Classes.DuplicateClassName" />
<rule ref="Generic.Classes.OpeningBraceSameLine" />
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement" />
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier" />
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
<rule ref="Generic.ControlStructures.InlineControlStructure" />
<rule ref="Generic.Files.ByteOrderMark" />
<rule ref="Generic.Files.EndFileNewline" />
<rule ref="Generic.Files.InlineHTML" />
<rule ref="Generic.Files.LineEndings" />
<rule ref="Generic.Files.LineLength" />
<rule ref="Generic.Files.OneClassPerFile" />
<rule ref="Generic.Files.OneInterfacePerFile" />
<rule ref="Generic.Files.OneObjectStructurePerFile" />
<rule ref="Generic.Files.OneTraitPerFile" />
<rule ref="Generic.Formatting.DisallowMultipleStatements" />
<rule ref="Generic.Formatting.NoSpaceAfterCast" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.Metrics.CyclomaticComplexity" />
<rule ref="Generic.Metrics.NestingLevel" />
<rule ref="Generic.NamingConventions.CamelCapsFunctionName" />
<rule ref="Generic.NamingConventions.ConstructorName" />
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
<rule ref="Generic.PHP.BacktickOperator" />
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
<rule ref="Generic.PHP.DisallowAlternativePHPTags" />
<rule ref="Generic.PHP.DisallowRequestSuperglobal" />
<rule ref="Generic.PHP.DisallowShortOpenTag" />
<rule ref="Generic.PHP.DiscourageGoto" />
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="die" value="null"/>
<element key="exit" value="null"/>
</property>
</properties>
</rule>
<rule ref="Generic.PHP.LowerCaseConstant" />
<rule ref="Generic.PHP.LowerCaseKeyword" />
<rule ref="Generic.PHP.LowerCaseType" />
<rule ref="Generic.PHP.NoSilencedErrors" />
<rule ref="Generic.PHP.Syntax" />
<rule ref="Generic.PHP.Syntax" />
<rule ref="Generic.VersionControl.GitMergeConflict" />
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing" />
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing" />
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing" />
</ruleset>
44 changes: 44 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" ?>
<ruleset name="PHP.Gt ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Custom ruleset</description>

<rule ref="rulesets/codesize.xml">
</rule>

<rule ref="rulesets/cleancode.xml">
<exclude name="BooleanArgumentFlag" />
<exclude name="ElseExpression" />
<exclude name="IfStatementAssignment" />
</rule>

<rule ref="rulesets/controversial.xml">
</rule>

<rule ref="rulesets/design.xml">
<exclude name="NumberOfChildren" />
</rule>

<rule ref="rulesets/naming.xml">
<exclude name="ShortMethodName" />
<exclude name="ShortVariable" />
<exclude name="LongVariable" />
</rule>

<rule ref="rulesets/unusedcode.xml">
</rule>

<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="a,b,i" />
</properties>
</rule>
<rule ref="rulesets/naming.xml/ShortMethodName">
<properties>
<property name="exceptions" value="or,do" />
</properties>
</rule>
</ruleset>
28 changes: 28 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
colors="true"
cacheDirectory="test/phpunit/.phpunit.cache"
bootstrap="vendor/autoload.php"
>
<coverage />

<testsuites>
<testsuite name="main">
<directory>
./test/phpunit/
</directory>
</testsuite>
</testsuites>

<logging />

<source>
<include>
<directory>
src/
</directory>
</include>
</source>
</phpunit>

0 comments on commit d056bef

Please sign in to comment.