Commit fa4c8568 authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Centralized code style

parent b4cdfe68
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -31,13 +31,11 @@
    "require-dev": {
        "ext-gmp": "*",
        "brick/math": "*",
        "dealerdirect/phpcodesniffer-composer-installer": "*",
        "mikey179/vfsstream": "^1.6",
        "pear/math_biginteger": "^1.0",
        "phpcompatibility/php-compatibility": "*",
        "phpunit/phpunit": ">=6.0.0 <10",
        "psy/psysh": "*",
        "slevomat/coding-standard": "*",
        "sandfox.dev/code-standard": "7.0.x@dev",
        "squizlabs/php_codesniffer": "*"
    },
    "suggest": {
+1 −30
Original line number Diff line number Diff line
@@ -3,36 +3,7 @@
    @see https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
-->
<ruleset name="Custom Standard" namespace="MyProject\CS\Standard">
    <rule ref="PSR12">
        <!-- We target versions < 7.1 -->
        <exclude name="PSR12.Properties.ConstantVisibility.NotFound"/>
        <!-- Not part of PSR -->
        <exclude name="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"/>
    </rule>
    <rule ref="PHPCompatibility"/>
    <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
        <properties>
            <property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
            <property name="newlinesCountAfterDeclare" value="2"/>
            <property name="spacesCountAroundEqualsSign" value="0"/>
        </properties>
    </rule>
<!--    <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">-->
<!--        <exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>-->
<!--    </rule>-->
<!--    <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>-->
<!--    <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>-->
    <rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions">
        <properties>
            <property name="includeSpecialFunctions" value="1"/>
            <property name="include" type="array">
                <element value="gmp_init"/> <!-- ensure root level gmp -->
            </property>
        </properties>
    </rule>
    <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
    <rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
    <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
    <rule ref="Sandfox"/>
    <config name="testVersion" value="7.0-"/>
    <file>src</file>
    <file>tests</file>
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ use SandFoxMe\Bencode\Exceptions\ParseErrorException;

class DecodeIntegerTest extends TestCase
{
    private function errorMsg($value)
    private function errorMsg(string $value): string
    {
        return "Invalid integer format or integer overflow: '{$value}'";
    }
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ use SandFoxMe\Bencode\Exceptions\ParseErrorException;

class DecodeStringTest extends TestCase
{
    private function errorMsgLength($value)
    private function errorMsgLength(string $value): string
    {
        return "Invalid string length value: '{$value}'";
    }
+1 −1

File changed.

Contains only whitespace changes.