skqr/hateoas

View on GitHub

Showing 662 of 662 total issues

Avoid using static access to class '\GoIntegro\Hateoas\Util\ArrayHelper' in method 'prepareData'.
Open

            $json = Util\ArrayHelper::toObject($data);
Severity: Minor
Found in JsonApi/Request/BodyParser.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Avoid unused parameters such as '$request'.
Open

    public function parse(Request $request, Params $params)
Severity: Minor
Found in JsonApi/Request/UnlinkBodyParser.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Only one argument is allowed per line in a multi-line function call
Open

                $relationship->type, EntityResource::getStringId($entity)

Only one argument is allowed per line in a multi-line function call
Open

                $resource, $relationship

Only one argument is allowed per line in a multi-line function call
Open

                    $params->primaryClass, $fields, $relationships, $metadata
Severity: Minor
Found in Entity/Builder.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

            $class->getConstructor(), $fields, $relationships, $metadata
Severity: Minor
Found in Entity/DefaultBuilder.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

                self::ERROR_MALFORMED_SCHEMA, $params->primaryType

Only one argument is allowed per line in a multi-line function call
Open

                (string) $entity->getId(), $params->relationshipIds

Only one argument is allowed per line in a multi-line function call
Open

            ' ', '', ucwords(str_replace('-', ' ', $word))
Severity: Minor
Found in Util/Inflector.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

            $type, $subtype, $resourceClass, $fields, $relationships, $pageSize

Only one argument is allowed per line in a multi-line function call
Open

                    $champion[$key], $links, $compare
Severity: Minor
Found in JsonApi/Merge/Blender.php by phpcodesniffer

Only one argument is allowed per line in a multi-line function call
Open

                $entity, $relationshipName

Only one argument is allowed per line in a multi-line function call
Open

                    self::ERROR_UNKOWN_RELATIONSHIP, $relationshipName

Only one argument is allowed per line in a multi-line function call
Open

                    $field, $this->resource, $message

Only one argument is allowed per line in a multi-line function call
Open

            $type, $subtype, $resourceClass, $fields, $relationships, $pageSize

Only one argument is allowed per line in a multi-line function call
Open

                    $relationship, $entity, $resourcesSerialization

Only one argument is allowed per line in a multi-line function call
Open

                    $relationship, $entity, $resourcesSerialization

Only one argument is allowed per line in a multi-line function call
Open

                    self::ERROR_UNKOWN_RELATIONSHIP, $relationshipName

Only one argument is allowed per line in a multi-line function call
Open

            $resource, $this->securityContext, $fields

Only one argument is allowed per line in a multi-line function call
Open

            $this->metadataCache, $this->resourceClassPath, $oreClass
Severity
Category
Status
Source
Language