nilportugues / php-json-api

JSON API transformer outputting valid (PSR-7) API Responses.
http://nilportugues.com
MIT License
71 stars 35 forks source link

[Insight] Unused method, property, variable or parameter - in src/Server/Data/DataAssertions.php, line 131 #57

Closed nilportugues closed 8 years ago

nilportugues commented 8 years ago

in src/Server/Data/DataAssertions.php, line 131

This errorBag local variable is declared but never used. You should remove it.


        $hasErrors = false;
        foreach ($inputAttributes as $property) {
            if (false === in_array($property, $properties)) {
                $hasErrors = true;
                $errorBag[] = new InvalidAttributeError($property, $data[JsonApiTransformer::TYPE_KEY]);
            }
        }

        if ($hasErrors) {
            throw new DataException();

Posted from SensioLabsInsight

nilportugues commented 8 years ago

https://github.com/nilportugues/php-json-api/commit/7155818c5fe26dc50c33b68e50bd3c701892ee2a