Skip to content

Commit c2000ef

Browse files
authored
Apply fixes from StyleCI (#22)
[ci skip] [skip ci]
1 parent c2b6766 commit c2000ef

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

config/laravel-swagger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@
8181

8282
'parseSecurity' => true,
8383

84-
'authFlow' => 'accessCode'
84+
'authFlow' => 'accessCode',
8585
];

src/Generator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@ protected function generateSecurityDefinitions()
110110
self::SECURITY_DEFINITION_NAME => [
111111
'type' => 'oauth2',
112112
'flow' => $authFlow,
113-
]
113+
],
114114
];
115115

116-
117116
if (in_array($authFlow, ['implicit', 'accessCode'])) {
118117
$securityDefinition[self::SECURITY_DEFINITION_NAME]['authorizationUrl'] = $this->getEndpoint(self::OAUTH_AUTHORIZE_PATH);
119118
}
@@ -174,7 +173,7 @@ protected function addActionScopes()
174173
foreach ($this->route->middleware() as $middleware) {
175174
if ($middleware->name() === 'scope' || $middleware->name() === 'scopes') {
176175
$this->docs['paths'][$this->route->uri()][$this->method]['security'] = [
177-
self::SECURITY_DEFINITION_NAME => $middleware->parameters()
176+
self::SECURITY_DEFINITION_NAME => $middleware->parameters(),
178177
];
179178
}
180179
}
@@ -242,7 +241,7 @@ private function isFilteredRoute()
242241
}
243242

244243
/**
245-
* Assumes routes have been created using Passport::routes()
244+
* Assumes routes have been created using Passport::routes().
246245
*/
247246
private function hasOauthRoutes()
248247
{

tests/GeneratorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function testRequiredBaseInfoData()
8888
public function testSecurityDefinitionsAccessCodeFlow()
8989
{
9090
$docs = $this->getDocsWithNewConfig([
91-
'authFlow' => 'accessCode'
91+
'authFlow' => 'accessCode',
9292
]);
9393

9494
$this->assertArrayHasKey('securityDefinitions', $docs);
@@ -106,7 +106,7 @@ public function testSecurityDefinitionsAccessCodeFlow()
106106
public function testSecurityDefinitionsImplicitFlow()
107107
{
108108
$docs = $this->getDocsWithNewConfig([
109-
'authFlow' => 'implicit'
109+
'authFlow' => 'implicit',
110110
]);
111111

112112
$securityDefinition = $docs['securityDefinitions']['OAuth2'];
@@ -120,7 +120,7 @@ public function testSecurityDefinitionsImplicitFlow()
120120
public function testSecurityDefinitionsPasswordFlow()
121121
{
122122
$docs = $this->getDocsWithNewConfig([
123-
'authFlow' => 'password'
123+
'authFlow' => 'password',
124124
]);
125125

126126
$securityDefinition = $docs['securityDefinitions']['OAuth2'];
@@ -134,7 +134,7 @@ public function testSecurityDefinitionsPasswordFlow()
134134
public function testSecurityDefinitionsApplicationFlow()
135135
{
136136
$docs = $this->getDocsWithNewConfig([
137-
'authFlow' => 'application'
137+
'authFlow' => 'application',
138138
]);
139139

140140
$securityDefinition = $docs['securityDefinitions']['OAuth2'];
@@ -159,7 +159,7 @@ public function testInvalidFlowPassed()
159159
$this->expectException(LaravelSwaggerException::class);
160160

161161
$this->getDocsWithNewConfig([
162-
'authFlow' => 'invalidFlow'
162+
'authFlow' => 'invalidFlow',
163163
]);
164164
}
165165

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ protected function getPackageProviders($app)
1515

1616
protected function getEnvironmentSetUp($app)
1717
{
18-
$app['router']->middleware(['some-middleware', 'scope:user-read'])->group(function() use($app) {
18+
$app['router']->middleware(['some-middleware', 'scope:user-read'])->group(function () use ($app) {
1919
$app['router']->get('/users', 'Mtrajano\\LaravelSwagger\\Tests\\Stubs\\Controllers\\UserController@index');
2020
$app['router']->get('/users/{id}', 'Mtrajano\\LaravelSwagger\\Tests\\Stubs\\Controllers\\UserController@show');
2121
$app['router']->post('/users', 'Mtrajano\\LaravelSwagger\\Tests\\Stubs\\Controllers\\UserController@store')

0 commit comments

Comments
 (0)