Skip to content

Commit 67c2ac7

Browse files
committed
Merge pull request dingo#557 from GrahamForks/cs
CS Fixes
2 parents fa0eb8f + 70d31fc commit 67c2ac7

File tree

29 files changed

+65
-69
lines changed

29 files changed

+65
-69
lines changed

.styleci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
preset: psr2
1+
preset: recommended
2+
3+
linting: true
24

35
enabled:
4-
- short_array_syntax
6+
- logical_not_operators_with_successor_space
7+
8+
disabled:
9+
- align_double_arrow
10+
- new_with_braces
11+
- ordered_use
12+
- psr0

config/api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
'errors' => ':errors',
124124
'code' => ':code',
125125
'status_code' => ':status_code',
126-
'debug' => ':debug'
126+
'debug' => ':debug',
127127
],
128128

129129
/*
@@ -188,6 +188,6 @@
188188

189189
'json' => 'Dingo\Api\Http\Response\Format\Json',
190190

191-
]
191+
],
192192

193193
];

src/Auth/Provider/OAuth2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(ResourceServer $resource, $httpHeadersOnly = false)
5858
/**
5959
* Authenticate request with the OAuth 2.0 resource server.
6060
*
61-
* @param \Illuminate\Http\Request $request
61+
* @param \Illuminate\Http\Request $request
6262
* @param \Dingo\Api\Routing\Route $route
6363
*
6464
* @throws \Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException

src/Console/Command/Cache.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Dingo\Api\Routing\Router;
66
use Illuminate\Console\Command;
77
use Illuminate\Filesystem\Filesystem;
8-
use Symfony\Component\Console\Input\InputOption;
98

109
class Cache extends Command
1110
{

src/Console/Command/Docs.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Docs extends Command
1515
*
1616
* @var \Dingo\Api\Routing\Router
1717
*/
18-
1918
protected $router;
2019

2120
/**
@@ -150,7 +149,7 @@ protected function getControllers()
150149
foreach ($this->router->getRoutes() as $collections) {
151150
foreach ($collections as $route) {
152151
if ($controller = $route->getController()) {
153-
if (!$controllers->contains($controller)) {
152+
if (! $controllers->contains($controller)) {
154153
$controllers->push($controller);
155154
}
156155
}

src/Console/Command/Routes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Routes extends RouteListCommand
4040
/**
4141
* Create a new routes command instance.
4242
*
43-
* @param \Dingo\Api\Routing\Router $router
43+
* @param \Dingo\Api\Routing\Router $router
4444
*
4545
* @return void
4646
*/
@@ -71,7 +71,7 @@ protected function getRoutes()
7171
'action' => $route->getActionName(),
7272
'protected' => $this->routeHasAuthMiddleware($route) ? 'Yes' : 'No',
7373
'versions' => implode(', ', $route->versions()),
74-
'scopes' => implode(', ', $route->scopes())
74+
'scopes' => implode(', ', $route->scopes()),
7575
]);
7676
}
7777
}
@@ -143,7 +143,7 @@ protected function getOptions()
143143
['versions', null, InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Filter the routes by version'],
144144
['scopes', 'S', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL, 'Filter the routes by scopes'],
145145
['protected', null, InputOption::VALUE_NONE, 'Filter the protected routes'],
146-
['unprotected', null, InputOption::VALUE_NONE, 'Filter the unprotected routes']
146+
['unprotected', null, InputOption::VALUE_NONE, 'Filter the unprotected routes'],
147147
]
148148
);
149149
}

src/Dispatcher.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@
22

33
namespace Dingo\Api;
44

5-
use RuntimeException;
65
use Dingo\Api\Auth\Auth;
76
use Illuminate\Http\Request;
87
use Dingo\Api\Routing\Router;
98
use Illuminate\Container\Container;
109
use Dingo\Api\Http\InternalRequest;
1110
use Illuminate\Filesystem\Filesystem;
12-
use Illuminate\Auth\GenericUser;
13-
use Illuminate\Database\Eloquent\Model;
1411
use Symfony\Component\HttpFoundation\Cookie;
1512
use Dingo\Api\Exception\InternalHttpException;
1613
use Symfony\Component\HttpFoundation\File\UploadedFile;

src/Exception/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function prepareReplacements(Exception $exception)
214214

215215
$replacements = [
216216
':message' => $message,
217-
':status_code' => $statusCode
217+
':status_code' => $statusCode,
218218
];
219219

220220
if ($exception instanceof ResourceException && $exception->hasErrors()) {
@@ -230,7 +230,7 @@ protected function prepareReplacements(Exception $exception)
230230
'line' => $exception->getLine(),
231231
'file' => $exception->getFile(),
232232
'class' => get_class($exception),
233-
'trace' => explode("\n", $exception->getTraceAsString())
233+
'trace' => explode("\n", $exception->getTraceAsString()),
234234
];
235235
}
236236

src/Http/Middleware/Auth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Auth
2626
* Create a new auth middleware instance.
2727
*
2828
* @param \Dingo\Api\Routing\Router $router
29-
* @param \Dingo\Api\Auth\Auth $auth
29+
* @param \Dingo\Api\Auth\Auth $auth
3030
*/
3131
public function __construct(Router $router, Authentication $auth)
3232
{
@@ -38,7 +38,7 @@ public function __construct(Router $router, Authentication $auth)
3838
* Perform authentication before a request is executed.
3939
*
4040
* @param \Illuminate\Http\Request $request
41-
* @param \Closure $next
41+
* @param \Closure $next
4242
*
4343
* @return mixed
4444
*/

src/Http/Middleware/RateLimit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function getHeaders()
9797
return [
9898
'X-RateLimit-Limit' => $this->handler->getThrottleLimit(),
9999
'X-RateLimit-Remaining' => $this->handler->getRemainingLimit(),
100-
'X-RateLimit-Reset' => $this->handler->getRateLimitReset()
100+
'X-RateLimit-Reset' => $this->handler->getRateLimitReset(),
101101
];
102102
}
103103
}

0 commit comments

Comments
 (0)