Skip to content

Commit

Permalink
Bumped minimum PHP version and used Qubus coding standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
nomadicjosh committed Aug 27, 2023
1 parent c4d5b8b commit 477a53c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 114 deletions.
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
"authors": [
{
"name": "Joshua Parker",
"email": "josh@joshuaparker.blog",
"email": "joshua@joshuaparker.dev",
"role": "Developer"
}
],
"require": {
"php": ">=8.1",
"friendsofphp/proxy-manager-lts": "^1.0",
"php": ">=8.2",
"friendsofphp/proxy-manager-lts": "^1",
"psr/container": "^2",
"qubus/config": "^2.0",
"qubus/exception": "^2.0"
"qubus/config": "^3",
"qubus/exception": "^3"
},
"require-dev": {
"laminas/laminas-coding-standard": "^2.0",
"mockery/mockery": "1.3.1",
"phpunit/phpunit": "^9.0",
"qubus/qubus-coding-standard": "^1.1",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
Expand Down
112 changes: 4 additions & 108 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<file>./Cache</file>
<file>./Config</file>
<file>./Psr11</file>
<file>./ServiceProvider</file>
<file>./ConfigException.php</file>
<file>./Executable.php</file>
<file>./Injection.php</file>
Expand All @@ -24,114 +25,9 @@
<file>./InjectorException.php</file>
<file>./InvalidMappingsException.php</file>
<file>./Reflector.php</file>
<file>./ServiceContainer.php</file>
<file>./StandardReflector.php</file>

<!-- Additional QubusPHP Coding Standard rules. -->

<!-- File names should be lowercased and class names should be uppercase. -->
<rule ref="Generic.Files.LowercasedFilename">
<exclude name="Generic.Files.LowercasedFilename.NotFound"/>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName"/>
</rule>

<!-- A cast statement MUST NOT be preceeded by a single space. -->
<rule ref="Generic.Formatting.SpaceBeforeCast">
<exclude name="Generic.Formatting.SpaceBeforeCast.NoSpace"/>
</rule>

<!-- The Short array syntax MUST be used-->
<rule ref="Generic.Arrays.DisallowShortArraySyntax">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/>
</rule>

<!-- Opening brace must be on a new line. -->
<rule ref="Generic.Classes.OpeningBraceSameLine">
<exclude name="Generic.Classes.OpeningBraceSameLine.BraceOnNewLine"/>
</rule>

<!-- Opening brace should be on a new line after declaration. -->
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie">
<exclude name="Generic.Functions.OpeningFunctionBraceKernighanRitchie.BraceOnNewLine"/>
</rule>

<!-- Constants true, false and null MUST be lowercase. -->
<rule ref="Generic.PHP.UpperCaseConstant">
<exclude name="Generic.PHP.UpperCaseConstant.Found"/>
</rule>
<rule ref="Generic.PHP.LowerCaseConstant"/>

<!-- There MUST be at least one space on either side of an equals sign used
to assign a value to a variable. In case of a block of related
assignments, more spaces MUST NOT be inserted before the equal sign. -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSame"/>
<properties>
<property name="error" value="true"/>
<property name="maxPadding" value="50"/>
</properties>
</rule>

<!-- Code MUST use an indent of 4 spaces for each indent level, and MUST
NOT use tabs for indenting. If tabs are use, indent with 4 spaces. -->
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="exact" value="true"/>
<property name="tabIndent" value="true"/>
<property name="--tab-width" value="4"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent">
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
</rule>

<!-- Abstract classes MUST NOT have an `Abstract` prefix/suffix. -->
<rule ref="WebimpressCodingStandard.NamingConventions.AbstractClass">
<exclude name="WebimpressCodingStandard.NamingConventions.AbstractClass.Prefix"/>
<exclude name="WebimpressCodingStandard.NamingConventions.AbstractClass.Suffix"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>

<!-- Exception classes MUST have an `Exception` suffix. -->
<rule ref="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming">
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming.SuperfluousSuffix"/>
</rule>
<rule ref="WebimpressCodingStandard.NamingConventions.Exception"/>

<!-- Interface classes MUST NOT have an `Interface` prefix/suffix. -->
<rule ref="WebimpressCodingStandard.NamingConventions.Interface">
<exclude name="WebimpressCodingStandard.NamingConventions.Interface.Prefix"/>
<exclude name="WebimpressCodingStandard.NamingConventions.Interface.Suffix"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>

<!-- Trait classes MUST NOT have a `Trait` prefix/suffix. -->
<rule ref="WebimpressCodingStandard.NamingConventions.Trait">
<exclude name="WebimpressCodingStandard.NamingConventions.Trait.Prefix"/>
<exclude name="WebimpressCodingStandard.NamingConventions.Trait.Suffix"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>

<!-- The Yoda comparison CAN be used. -->
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison">
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison.DisallowedYodaComparison"/>
</rule>

<!-- @author and @copyright Annotations can be used. -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations"/>
</rule>

<!-- File names should be lowercased and class names should be uppercase. -->
<rule ref="Generic.Files.LowercasedFilename">
<exclude name="Generic.Files.LowercasedFilename.NotFound"/>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName"/>
</rule>

<!-- Include the rest of the rules from the Laminas Coding Standard -->
<rule ref="LaminasCodingStandard"/>
<!-- Include rules from the Qubus Coding Standard -->
<rule ref="QubusCodingStandard"/>
</ruleset>

0 comments on commit 477a53c

Please sign in to comment.