diff --git a/src/DataObjects/Route.php b/src/DataObjects/Route.php index 1f034a2..d9994cf 100644 --- a/src/DataObjects/Route.php +++ b/src/DataObjects/Route.php @@ -208,7 +208,7 @@ private function _getTagValuesForDocblock(string $docBlock, string $tag): array $docBlock = $this->_docParserFactory->create($docBlock); - $values = array_map(function($tag) { + $values = array_map(function ($tag) { return (string) $tag; }, $docBlock->getTagsByName($tag)); diff --git a/src/SwaggerDocsManager.php b/src/SwaggerDocsManager.php index bd208e3..bb2a183 100644 --- a/src/SwaggerDocsManager.php +++ b/src/SwaggerDocsManager.php @@ -103,7 +103,7 @@ public function getSwaggerFileUrl(string $version): string $fileName = $this->generateSwaggerFileName($version, $format); - return sprintf("%s/%s", config('app.url'), $fileName); + return sprintf('%s/%s', config('app.url'), $fileName); } /** diff --git a/src/helpers.php b/src/helpers.php index 686c208..1738e47 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,7 +2,6 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; -use Illuminate\Support\Str; if (!function_exists('strip_optional_char')) { function strip_optional_char($uri) diff --git a/tests/DataObjects/RouteTest.php b/tests/DataObjects/RouteTest.php index 4db1479..118de47 100644 --- a/tests/DataObjects/RouteTest.php +++ b/tests/DataObjects/RouteTest.php @@ -2,9 +2,9 @@ namespace Mtrajano\LaravelSwagger\Tests\DataObjects; +use Illuminate\Database\Eloquent\Model as LaravelModel; use Illuminate\Routing\Controller as LaravelController; use Illuminate\Routing\Route as LaravelRoute; -use Illuminate\Database\Eloquent\Model as LaravelModel; use Mtrajano\LaravelSwagger\DataObjects; use Mtrajano\LaravelSwagger\LaravelSwaggerException; use Mtrajano\LaravelSwagger\Tests\TestCase; @@ -22,7 +22,7 @@ protected function setUp(): void $this->_laravel_route = $this->createMock(LaravelRoute::class); $this->_laravel_route ->method('gatherMiddleware') - ->willReturnCallback(function() { + ->willReturnCallback(function () { return $this->_laravel_middleware; }); @@ -56,7 +56,6 @@ protected function getEnvironmentSetUp($app) $app['router'] ->get('/model-route-class', 'Mtrajano\LaravelSwagger\Tests\DataObjects\ModelRoute@delete') ->name('model-route-class'); - } public function testGetOriginalUriDoesNotPrefixIfPrefixedAlready(): void @@ -91,7 +90,7 @@ public function testGetMiddleware(): void $this->_laravel_middleware = [ 'signed', 'auth:api', - 'throttle:60,1' + 'throttle:60,1', ]; $this->_route = new DataObjects\Route($this->_laravel_route); @@ -104,7 +103,7 @@ public function testGetMiddleware(): void /** * @todo test with actual laravel route */ - public function testGetAction(): void + public function testGetAction(): void { $this->_laravel_route ->method('getActionName') @@ -340,4 +339,4 @@ class ActionModel extends LaravelModel class InvalidModel { -} \ No newline at end of file +} diff --git a/tests/Responses/ResponseGeneratorTest.php b/tests/Responses/ResponseGeneratorTest.php index 0685546..c2260f7 100644 --- a/tests/Responses/ResponseGeneratorTest.php +++ b/tests/Responses/ResponseGeneratorTest.php @@ -151,8 +151,8 @@ public function provideRoutesToGenerateResponse() [ '204' => [ 'description' => 'No Content', - ] - ] + ], + ], ], [ 'customers.destroy', diff --git a/tests/SwaggerDocsManagerTest.php b/tests/SwaggerDocsManagerTest.php index 23094d3..faa3265 100644 --- a/tests/SwaggerDocsManagerTest.php +++ b/tests/SwaggerDocsManagerTest.php @@ -151,7 +151,8 @@ public function provideInvalidFileNames(): array /** * @dataProvider provideInvalidFileNames */ - public function testChangeFileNameGeneratorReturningInvalidFileName($invalidFileName): void { + public function testChangeFileNameGeneratorReturningInvalidFileName($invalidFileName): void + { $this->expectException(RuntimeException::class); SwaggerDocsManager::setFileNameGenerator(