Skip to content

Apply fixes from StyleCI #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v0.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/DataObjects/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/SwaggerDocsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 5 additions & 6 deletions tests/DataObjects/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
});

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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')
Expand Down Expand Up @@ -340,4 +339,4 @@ class ActionModel extends LaravelModel

class InvalidModel
{
}
}
4 changes: 2 additions & 2 deletions tests/Responses/ResponseGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ public function provideRoutesToGenerateResponse()
[
'204' => [
'description' => 'No Content',
]
]
],
],
],
[
'customers.destroy',
Expand Down
3 changes: 2 additions & 1 deletion tests/SwaggerDocsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down