wol-soft/php-json-schema-model-generator

View on GitHub
src/Model/Property/PropertyProxy.php

Summary

Maintainability
A
2 hrs
Test Coverage
D
64%

PropertyProxy has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class PropertyProxy extends AbstractProperty
{
    /**
     * PropertyProxy constructor.
     *
Severity: Minor
Found in src/Model/Property/PropertyProxy.php - About 2 hrs to fix

    The method getTypeHint has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getTypeHint(bool $outputType = false, array $skipDecorators = []): string
    Severity: Minor
    Found in src/Model/Property/PropertyProxy.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method setDefaultValue has a boolean flag argument $raw, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setDefaultValue($defaultValue, bool $raw = false): PropertyInterface
    Severity: Minor
    Found in src/Model/Property/PropertyProxy.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method setType has a boolean flag argument $reset, which is a certain sign of a Single Responsibility Principle violation.
    Open

            bool $reset = false,
    Severity: Minor
    Found in src/Model/Property/PropertyProxy.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method getType has a boolean flag argument $outputType, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getType(bool $outputType = false): ?PropertyType
    Severity: Minor
    Found in src/Model/Property/PropertyProxy.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE)
    Open

            protected ResolvedDefinitionsCollection $definitionsCollection,
    Severity: Critical
    Found in src/Model/Property/PropertyProxy.php by phan

    Arguments with default values must be at the end of the argument list
    Open

            bool $reset = false,

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            protected ResolvedDefinitionsCollection $definitionsCollection,

    Multi-line function call not indented correctly; expected 12 spaces but found 16
    Open

                    $propertyValidator->withProperty($this),

    Line indented incorrectly; expected 4 spaces, found 8
    Open

            protected string $key,

    There are no issues that match your filters.

    Category
    Status