From e6f4e74e851fb5e911d1ddc1d314803a1dc9b12f Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 10:36:50 +0300 Subject: [PATCH 1/9] Updated .travis.yml --- .travis.yml | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index ea16c2ef..433a7d45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,36 @@ +dist: bionic language: php -php: - - 7.3 - - 7.2 - env: - - PREFER_LOWEST="" - - PREFER_LOWEST="--prefer-lowest" + global: + - SETUP=stable -jobs: +matrix: + fast_finish: true include: - - script: composer lint - name: "Lint code" - php: 7.3 - env: PREFER_LOWEST="" + - php: 7.2 + - php: 7.2 + env: SETUP=lowest + - php: 7.3 + - php: 7.3 + env: SETUP=lowest + - php: 7.4 + - php: 7.4 + env: SETUP=lowest + - php: 7.4 + env: SETUP=lint + +cache: + directories: + - $HOME/.composer/cache -script: composer test-ci -before_script: +before_install: - travis_retry composer self-update - - travis_retry composer update --no-interaction --prefer-dist $PREFER_LOWEST + +install: + - if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi + - if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi + - if [[ $SETUP = 'lint' ]]; then travis_retry composer lint; fi + +script: + - vendor/bin/phpunit From 46e7a65e3223a9a7b70bfd9780b2b31f171065b5 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 11:01:46 +0300 Subject: [PATCH 2/9] Fixed error applying the parameter --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index b2aee221..3be37d13 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ parameters: level: 5 reportUnmatchedIgnoredErrors: false - inferPrivatePropertyTypeFromConstructor:: true + inferPrivatePropertyTypeFromConstructor: true ignoreErrors: - '#Call to an undefined static method Illuminate\\Support\\Facades\\Route::getRoutes().#' - '#Call to an undefined static method Illuminate\\Support\\Facades\\URL::forceRootUrl()#' From 6146b5d3ca22fa979b2941224c29cccb0242ed6e Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:27:33 +0300 Subject: [PATCH 3/9] Added support for PHP 7.4 and updated dependencies to the latest versions Also see https://github.com/sebastianbergmann/phpunit/pull/3765/commits/015ac15d7f3b1d4da8d40d18ccbf81339314bba0 --- .travis.yml | 2 +- composer.json | 21 ++++++++------- src/Extracting/Generator.php | 2 +- .../Responses/UseTransformerTags.php | 4 +-- tests/GenerateDocumentationTest.php | 26 +++++++++---------- tests/TestHelpers.php | 2 +- tests/Unit/GeneratorPluginSystemTestCase.php | 3 +++ tests/Unit/GeneratorTestCase.php | 3 +++ tests/Unit/RouteMatcherTest.php | 8 +++--- 9 files changed, 39 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 433a7d45..0a0503da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: - php: 7.4 - php: 7.4 env: SETUP=lowest - - php: 7.4 + - php: 7.3 env: SETUP=lint cache: diff --git a/composer.json b/composer.json index 154b5be0..6f937c67 100644 --- a/composer.json +++ b/composer.json @@ -17,23 +17,24 @@ "require": { "php": ">=7.2.0", "fzaninotto/faker": "^1.8", - "illuminate/routing": "^5.7|^6.0", - "illuminate/support": "^5.7|^6.0", - "illuminate/console": "^5.7|^6.0", + "illuminate/console": "^5.7|^6.0|^7.0", + "illuminate/routing": "^5.7|^6.0|^7.0", + "illuminate/support": "^5.7|^6.0|^7.0", + "league/flysystem": "^1.0", "mpociot/documentarian": "^0.3.0", "mpociot/reflection-docblock": "^1.0.1", + "nunomaduro/collision": "^3.0", "ramsey/uuid": "^3.8", - "symfony/var-exporter": "^4.0", - "league/flysystem": "^1.0", - "nunomaduro/collision": "^3.0" + "symfony/var-exporter": "^4.0|^5.0" }, "require-dev": { - "orchestra/testbench": "^3.7.0 || ^4.0", - "phpunit/phpunit": "^7.5.0", "dingo/api": "^2.3.0", - "mockery/mockery": "^1.2.0", + "dms/phpunit-arraysubset-asserts": "^0.1.0", "league/fractal": "^0.17.0", - "phpstan/phpstan": "^0.11.15" + "mockery/mockery": "^1.2.0", + "orchestra/testbench": "^3.7|^4.0", + "phpstan/phpstan": "^0.11.15", + "phpunit/phpunit": "^8.0" }, "suggest": { "league/fractal": "Required for transformers support" diff --git a/src/Extracting/Generator.php b/src/Extracting/Generator.php index be60e071..f7b79675 100644 --- a/src/Extracting/Generator.php +++ b/src/Extracting/Generator.php @@ -51,7 +51,7 @@ public function getMethods(Route $route) */ public function processRoute(Route $route, array $routeRules = []) { - list($controllerName, $methodName) = Utils::getRouteClassAndMethodNames($route->getAction()); + [$controllerName, $methodName] = Utils::getRouteClassAndMethodNames($route->getAction()); $controller = new ReflectionClass($controllerName); $method = $controller->getMethod($methodName); diff --git a/src/Extracting/Strategies/Responses/UseTransformerTags.php b/src/Extracting/Strategies/Responses/UseTransformerTags.php index cad06e55..7bda0a0a 100644 --- a/src/Extracting/Strategies/Responses/UseTransformerTags.php +++ b/src/Extracting/Strategies/Responses/UseTransformerTags.php @@ -125,9 +125,9 @@ private function getClassToBeTransformed(array $tags, ReflectionMethod $transfor $type = $modelTag->getContent(); } else { $parameter = Arr::first($transformerMethod->getParameters()); - if ($parameter->hasType() && ! $parameter->getType()->isBuiltin() && class_exists((string) $parameter->getType())) { + if ($parameter->hasType() && ! $parameter->getType()->isBuiltin() && class_exists($parameter->getType()->getName())) { // Ladies and gentlemen, we have a type! - $type = (string) $parameter->getType(); + $type = $parameter->getType()->getName(); } } diff --git a/tests/GenerateDocumentationTest.php b/tests/GenerateDocumentationTest.php index 92dba138..31387d0f 100644 --- a/tests/GenerateDocumentationTest.php +++ b/tests/GenerateDocumentationTest.php @@ -65,8 +65,8 @@ public function console_command_does_not_work_with_closure() config(['apidoc.routes.0.match.prefixes' => ['api/*']]); $output = $this->artisan('apidoc:generate'); - $this->assertContains('Skipping route: [GET] api/closure', $output); - $this->assertContains('Processed route: [GET] api/test', $output); + $this->assertStringContainsString('Skipping route: [GET] api/closure', $output); + $this->assertStringContainsString('Processed route: [GET] api/test', $output); } /** @test */ @@ -85,8 +85,8 @@ public function console_command_does_not_work_with_closure_using_dingo() config(['apidoc.routes.0.match.versions' => ['v1']]); $output = $this->artisan('apidoc:generate'); - $this->assertContains('Skipping route: [GET] closure', $output); - $this->assertContains('Processed route: [GET] test', $output); + $this->assertStringContainsString('Skipping route: [GET] closure', $output); + $this->assertStringContainsString('Processed route: [GET] test', $output); } /** @test */ @@ -97,8 +97,8 @@ public function console_command_work_with_routes_callable_tuple() config(['apidoc.routes.0.match.prefixes' => ['api/*']]); $output = $this->artisan('apidoc:generate'); - $this->assertNotContains('Skipping route: [GET] api/array/test', $output); - $this->assertContains('Processed route: [GET] api/array/test', $output); + $this->assertStringNotContainsString('Skipping route: [GET] api/array/test', $output); + $this->assertStringContainsString('Processed route: [GET] api/array/test', $output); } /** @test */ @@ -110,8 +110,8 @@ public function can_skip_single_routes() config(['apidoc.routes.0.match.prefixes' => ['api/*']]); $output = $this->artisan('apidoc:generate'); - $this->assertContains('Skipping route: [GET] api/skip', $output); - $this->assertContains('Processed route: [GET] api/test', $output); + $this->assertStringContainsString('Skipping route: [GET] api/skip', $output); + $this->assertStringContainsString('Processed route: [GET] api/test', $output); } /** @test */ @@ -122,8 +122,8 @@ public function can_skip_non_existent_response_files() config(['apidoc.routes.0.match.prefixes' => ['api/*']]); $output = $this->artisan('apidoc:generate'); - $this->assertContains('Skipping route: [GET] api/non-existent', $output); - $this->assertContains('@responseFile i-do-not-exist.json does not exist', $output); + $this->assertStringContainsString('Skipping route: [GET] api/non-existent', $output); + $this->assertStringContainsString('@responseFile i-do-not-exist.json does not exist', $output); } /** @test */ @@ -392,7 +392,7 @@ public function can_parse_utf8_response() $this->artisan('apidoc:generate'); $generatedMarkdown = file_get_contents(__DIR__.'/../resources/docs/source/index.md'); - $this->assertContains('Лорем ипсум долор сит амет', $generatedMarkdown); + $this->assertStringContainsString('Лорем ипсум долор сит амет', $generatedMarkdown); } /** @test */ @@ -437,7 +437,7 @@ public function supports_partial_resource_controller() $this->assertNull($thrownException); $generatedMarkdown = file_get_contents(__DIR__.'/../resources/docs/source/index.md'); - $this->assertContains('Group A', $generatedMarkdown); - $this->assertContains('Group B', $generatedMarkdown); + $this->assertStringContainsString('Group A', $generatedMarkdown); + $this->assertStringContainsString('Group B', $generatedMarkdown); } } diff --git a/tests/TestHelpers.php b/tests/TestHelpers.php index a4425c1d..94056610 100644 --- a/tests/TestHelpers.php +++ b/tests/TestHelpers.php @@ -48,6 +48,6 @@ private function assertContainsIgnoringWhitespace($needle, $haystack) { $haystack = preg_replace('/\s/', '', $haystack); $needle = preg_replace('/\s/', '', $needle); - $this->assertContains($needle, $haystack); + $this->assertStringContainsString($needle, $haystack); } } diff --git a/tests/Unit/GeneratorPluginSystemTestCase.php b/tests/Unit/GeneratorPluginSystemTestCase.php index 3f810631..9d5bc917 100644 --- a/tests/Unit/GeneratorPluginSystemTestCase.php +++ b/tests/Unit/GeneratorPluginSystemTestCase.php @@ -2,6 +2,7 @@ namespace Mpociot\ApiDoc\Tests\Unit; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use Illuminate\Routing\Route; use Mpociot\ApiDoc\ApiDocGeneratorServiceProvider; use Mpociot\ApiDoc\Extracting\Generator; @@ -13,6 +14,8 @@ class GeneratorPluginSystemTestCase extends LaravelGeneratorTest { + use ArraySubsetAsserts; + /** * @var \Mpociot\ApiDoc\Extracting\Generator */ diff --git a/tests/Unit/GeneratorTestCase.php b/tests/Unit/GeneratorTestCase.php index 22f5c6d8..4b08d8af 100644 --- a/tests/Unit/GeneratorTestCase.php +++ b/tests/Unit/GeneratorTestCase.php @@ -4,6 +4,7 @@ namespace Mpociot\ApiDoc\Tests\Unit; +use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; use Illuminate\Support\Arr; use Mpociot\ApiDoc\ApiDocGeneratorServiceProvider; use Mpociot\ApiDoc\Extracting\Generator; @@ -14,6 +15,8 @@ abstract class GeneratorTestCase extends TestCase { + use ArraySubsetAsserts; + /** * @var \Mpociot\ApiDoc\Extracting\Generator */ diff --git a/tests/Unit/RouteMatcherTest.php b/tests/Unit/RouteMatcherTest.php index ba4b34c1..6cbf09b5 100644 --- a/tests/Unit/RouteMatcherTest.php +++ b/tests/Unit/RouteMatcherTest.php @@ -37,7 +37,7 @@ public function testRespectsDomainsRuleForLaravelRouter() $routes = $matcher->getRoutes(); $this->assertCount(6, $routes); foreach ($routes as $route) { - $this->assertContains('domain1', $route['route']->getDomain()); + $this->assertStringContainsString('domain1', $route['route']->getDomain()); } $routeRules[0]['match']['domains'] = ['domain2.*']; @@ -45,7 +45,7 @@ public function testRespectsDomainsRuleForLaravelRouter() $routes = $matcher->getRoutes(); $this->assertCount(6, $routes); foreach ($routes as $route) { - $this->assertContains('domain2', $route['route']->getDomain()); + $this->assertStringContainsString('domain2', $route['route']->getDomain()); } } @@ -70,7 +70,7 @@ public function testRespectsDomainsRuleForDingoRouter() $routes = $matcher->getRoutes(); $this->assertCount(6, $routes); foreach ($routes as $route) { - $this->assertContains('domain1', $route['route']->getDomain()); + $this->assertStringContainsString('domain1', $route['route']->getDomain()); } $routeRules[0]['match']['domains'] = ['domain2.*']; @@ -78,7 +78,7 @@ public function testRespectsDomainsRuleForDingoRouter() $routes = $matcher->getRoutes(); $this->assertCount(6, $routes); foreach ($routes as $route) { - $this->assertContains('domain2', $route['route']->getDomain()); + $this->assertStringContainsString('domain2', $route['route']->getDomain()); } } From e32b6ee3bf590eb3e6a003edcab8fa256c1f877e Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:35:48 +0300 Subject: [PATCH 4/9] Added php-json extension into composer.json --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 6f937c67..bea30e4d 100644 --- a/composer.json +++ b/composer.json @@ -16,6 +16,7 @@ ], "require": { "php": ">=7.2.0", + "ext-json": "*", "fzaninotto/faker": "^1.8", "illuminate/console": "^5.7|^6.0|^7.0", "illuminate/routing": "^5.7|^6.0|^7.0", @@ -63,5 +64,9 @@ "branch-alias": { "dev-v4": "4.x-dev" } + }, + "config": { + "preferred-install": "dist", + "sort-packages": true } } From 38932f0a6239a0429501e00010bfcbe7318fa130 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:36:11 +0300 Subject: [PATCH 5/9] Updated dockblocks and optimized qualified classes --- src/Commands/GenerateDocumentation.php | 2 ++ src/Extracting/Generator.php | 2 ++ src/Extracting/ParamHelpers.php | 3 ++- src/Extracting/RouteDocBlocker.php | 1 + .../Strategies/Responses/UseTransformerTags.php | 16 ++++++++++------ src/Tools/Utils.php | 8 ++++++++ 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/Commands/GenerateDocumentation.php b/src/Commands/GenerateDocumentation.php index ec5568f8..69df1322 100644 --- a/src/Commands/GenerateDocumentation.php +++ b/src/Commands/GenerateDocumentation.php @@ -89,6 +89,8 @@ public function handle() * @param \Mpociot\ApiDoc\Extracting\Generator $generator * @param array $routes * + * @throws \ReflectionException + * * @return array */ private function processRoutes(Generator $generator, array $routes) diff --git a/src/Extracting/Generator.php b/src/Extracting/Generator.php index f7b79675..4f80bde5 100644 --- a/src/Extracting/Generator.php +++ b/src/Extracting/Generator.php @@ -47,6 +47,8 @@ public function getMethods(Route $route) * @param \Illuminate\Routing\Route $route * @param array $routeRules Rules to apply when generating documentation for this route * + * @throws \ReflectionException + * * @return array */ public function processRoute(Route $route, array $routeRules = []) diff --git a/src/Extracting/ParamHelpers.php b/src/Extracting/ParamHelpers.php index 0c566758..8e0e784a 100644 --- a/src/Extracting/ParamHelpers.php +++ b/src/Extracting/ParamHelpers.php @@ -3,6 +3,7 @@ namespace Mpociot\ApiDoc\Extracting; use Faker\Factory; +use stdClass; trait ParamHelpers { @@ -32,7 +33,7 @@ protected function generateDummyValue(string $type) return []; }, 'object' => function () { - return new \stdClass; + return new stdClass; }, ]; diff --git a/src/Extracting/RouteDocBlocker.php b/src/Extracting/RouteDocBlocker.php index 3576541b..a14558ce 100644 --- a/src/Extracting/RouteDocBlocker.php +++ b/src/Extracting/RouteDocBlocker.php @@ -20,6 +20,7 @@ class RouteDocBlocker * @param Route $route * * @throws \ReflectionException + * @throws \Exception * * @return array Method and class docblocks */ diff --git a/src/Extracting/Strategies/Responses/UseTransformerTags.php b/src/Extracting/Strategies/Responses/UseTransformerTags.php index 7bda0a0a..c6e4a1a7 100644 --- a/src/Extracting/Strategies/Responses/UseTransformerTags.php +++ b/src/Extracting/Strategies/Responses/UseTransformerTags.php @@ -4,6 +4,7 @@ use Exception; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Model as IlluminateModel; use Illuminate\Routing\Route; use Illuminate\Support\Arr; use League\Fractal\Manager; @@ -34,7 +35,7 @@ class UseTransformerTags extends Strategy * * @return array|null */ - public function __invoke(Route $route, \ReflectionClass $controller, \ReflectionMethod $method, array $rulesToApply, array $context = []) + public function __invoke(Route $route, ReflectionClass $controller, ReflectionMethod $method, array $rulesToApply, array $context = []) { $docBlocks = RouteDocBlocker::getDocBlocksFromRoute($route); /** @var DocBlock $methodDocBlock */ @@ -47,6 +48,7 @@ public function __invoke(Route $route, \ReflectionClass $controller, \Reflection * Get a response from the transformer tags. * * @param array $tags + * @param Route $route * * @return array|null */ @@ -57,7 +59,7 @@ protected function getTransformerResponse(array $tags, Route $route) return null; } - list($statusCode, $transformer) = $this->getStatusCodeAndTransformerClass($transformerTag); + [$statusCode, $transformer] = $this->getStatusCodeAndTransformerClass($transformerTag); $model = $this->getClassToBeTransformed($tags, (new ReflectionClass($transformer))->getMethod('transform')); $modelInstance = $this->instantiateTransformerModel($model); @@ -81,7 +83,7 @@ protected function getTransformerResponse(array $tags, Route $route) 'content' => $response->getContent(), ], ]; - } catch (\Exception $e) { + } catch (Exception $e) { echo 'Exception thrown when fetching transformer response for ['.implode(',', $route->methods)."] {$route->uri}.\n"; if (Flags::$shouldBeVerbose) { Utils::dumpException($e); @@ -112,6 +114,8 @@ private function getStatusCodeAndTransformerClass($tag): array * @param array $tags * @param ReflectionMethod $transformerMethod * + * @throws Exception + * * @return string */ private function getClassToBeTransformed(array $tags, ReflectionMethod $transformerMethod): string @@ -153,20 +157,20 @@ protected function instantiateTransformerModel(string $type) $type = ltrim($type, '\\'); return factory($type)->make(); - } catch (\Exception $e) { + } catch (Exception $e) { if (Flags::$shouldBeVerbose) { echo "Eloquent model factory failed to instantiate {$type}; trying to fetch from database.\n"; } $instance = new $type; - if ($instance instanceof \Illuminate\Database\Eloquent\Model) { + if ($instance instanceof IlluminateModel) { try { // we can't use a factory but can try to get one from the database $firstInstance = $type::first(); if ($firstInstance) { return $firstInstance; } - } catch (\Exception $e) { + } catch (Exception $e) { // okay, we'll stick with `new` if (Flags::$shouldBeVerbose) { echo "Failed to fetch first {$type} from database; using `new` to instantiate.\n"; diff --git a/src/Tools/Utils.php b/src/Tools/Utils.php index 70288439..c3e2be91 100644 --- a/src/Tools/Utils.php +++ b/src/Tools/Utils.php @@ -94,6 +94,14 @@ public static function deleteDirectoryAndContents($dir) $fs->deleteDir($dir); } + /** + * @param mixed $value + * @param int $indentationLevel + * + * @throws \Symfony\Component\VarExporter\Exception\ExceptionInterface + * + * @return string + */ public static function printPhpValue($value, $indentationLevel = 0) { $output = VarExporter::export($value); From 8eee0ee1f6df0e081f2532ddef3f8b19bb506bfa Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:41:01 +0300 Subject: [PATCH 6/9] Updated travis.ci --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0a0503da..433a7d45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: - php: 7.4 - php: 7.4 env: SETUP=lowest - - php: 7.3 + - php: 7.4 env: SETUP=lint cache: From e1c83d5699db58a78b4c923b73f64ec2b92869aa Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:43:23 +0300 Subject: [PATCH 7/9] Fixed `composer lint` command invocation in `.travis-ci.yml` --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 433a7d45..9a1fdf2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: install: - if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi - if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi - - if [[ $SETUP = 'lint' ]]; then travis_retry composer lint; fi + - if [[ $SETUP = 'lint' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; travis_retry composer lint; fi script: - vendor/bin/phpunit From 266bac67274c874637e65d3a3e30aaec1edf9e38 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Mon, 13 Jan 2020 12:48:45 +0300 Subject: [PATCH 8/9] Fixed codestyle --- tests/Unit/GeneratorTestCase.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Unit/GeneratorTestCase.php b/tests/Unit/GeneratorTestCase.php index 4b08d8af..e3e475f4 100644 --- a/tests/Unit/GeneratorTestCase.php +++ b/tests/Unit/GeneratorTestCase.php @@ -472,21 +472,21 @@ public function can_parse_apiresourcecollection_tags_with_collection_class() $content = json_decode($response['content'], true); $this->assertIsArray($content); $this->assertArraySubset([ - 'data' => [ - [ - 'id' => 4, - 'name' => 'Tested Again', - 'email' => 'a@b.com', - ], - [ - 'id' => 4, - 'name' => 'Tested Again', - 'email' => 'a@b.com', - ], + 'data' => [ + [ + 'id' => 4, + 'name' => 'Tested Again', + 'email' => 'a@b.com', ], - 'links' => [ - 'self' => 'link-value', + [ + 'id' => 4, + 'name' => 'Tested Again', + 'email' => 'a@b.com', ], + ], + 'links' => [ + 'self' => 'link-value', + ], ], $content); } From 309f338b69f82bb71a994cca1a246d0ef543e752 Mon Sep 17 00:00:00 2001 From: Shalvah Date: Sun, 19 Jan 2020 15:45:27 +0100 Subject: [PATCH 9/9] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9a1fdf2a..2087b8cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ matrix: env: SETUP=lowest - php: 7.4 env: SETUP=lint + name: "Lint code" cache: directories: