Skip to content

Commit 684eb1e

Browse files
committed
PSR-2 fixes
1 parent 9c92fec commit 684eb1e

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

tests/DispatcherTest.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ public function testInternalRequests()
7777

7878
public function testInternalRequestWithVersionAndParameters()
7979
{
80-
$this->router->api(['version' => 'v1'], function()
81-
{
82-
$this->router->get('test', function(){ return 'test'; });
80+
$this->router->api(['version' => 'v1'], function () {
81+
$this->router->get('test', function () { return 'test'; });
8382
});
8483

8584
$this->assertEquals('test', $this->dispatcher->version('v1')->with(['foo' => 'bar'])->get('test'));
@@ -89,7 +88,7 @@ public function testInternalRequestWithVersionAndParameters()
8988
public function testInternalRequestWithPrefix()
9089
{
9190
$this->router->api(['version' => 'v1', 'prefix' => 'baz'], function () {
92-
$this->router->get('test', function() {
91+
$this->router->get('test', function () {
9392
return 'test';
9493
});
9594
});
@@ -100,7 +99,7 @@ public function testInternalRequestWithPrefix()
10099

101100
public function testInternalRequestWithDomain()
102101
{
103-
$this->router->api(['version' => 'v1', 'domain' => 'foo.bar'], function() {
102+
$this->router->api(['version' => 'v1', 'domain' => 'foo.bar'], function () {
104103
$this->router->get('test', function () {
105104
return 'test';
106105
});
@@ -190,8 +189,7 @@ public function testInternalRequestUsingControllerAction()
190189

191190
public function testInternalRequestUsingRouteNameAndControllerAction()
192191
{
193-
$this->router->api(['version' => 'v1', 'prefix' => 'api'], function ()
194-
{
192+
$this->router->api(['version' => 'v1', 'prefix' => 'api'], function () {
195193
$this->router->get('foo', ['as' => 'foo', function () { return 'foo'; }]);
196194
$this->router->get('bar', 'Dingo\Api\Tests\Stubs\InternalControllerDispatchingStub@index');
197195
});
@@ -210,7 +208,7 @@ public function testInternalRequestWithMultipleVersionsCallsCorrectVersion()
210208
});
211209

212210
$this->router->api(['version' => ['v2', 'v3']], function () {
213-
$this->router->get('foo', function() {
211+
$this->router->get('foo', function () {
214212
return 'bar';
215213
});
216214
});
@@ -272,7 +270,7 @@ public function testRequestStackIsMaintained()
272270
public function testRouteStackIsMaintained()
273271
{
274272
$this->router->api(['version' => 'v1'], function () {
275-
$this->router->post('foo', ['as' => 'foo', function() {
273+
$this->router->post('foo', ['as' => 'foo', function () {
276274
$this->assertEquals('foo', $this->router->currentRouteName());
277275
$this->dispatcher->post('bar');
278276
$this->assertEquals('foo', $this->router->currentRouteName());

tests/Exception/HandlerTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Dingo\Api\Exception\Handler;
88
use Symfony\Component\HttpKernel\Exception\HttpException;
99

10-
class ExceptionHandlerTest extends PHPUnit_Framework_TestCase
10+
class HandlerTest extends PHPUnit_Framework_TestCase
1111
{
1212
public function setUp()
1313
{
@@ -17,14 +17,14 @@ public function setUp()
1717

1818
public function testRegisterExceptionHandler()
1919
{
20-
$this->exceptionHandler->register(function(HttpException $e){});
20+
$this->exceptionHandler->register(function (HttpException $e) {});
2121
$this->assertArrayHasKey('Symfony\Component\HttpKernel\Exception\HttpException', $this->exceptionHandler->getHandlers());
2222
}
2323

2424

2525
public function testExceptionHandlerWillHandleExceptionPasses()
2626
{
27-
$this->exceptionHandler->register(function(HttpException $e){});
27+
$this->exceptionHandler->register(function (HttpException $e) {});
2828
$this->assertTrue($this->exceptionHandler->willHandle(new HttpException(404)));
2929
}
3030

@@ -37,8 +37,7 @@ public function testExceptionHandlerWillHandleExceptionFails()
3737

3838
public function testExceptionHandlerHandlesException()
3939
{
40-
$this->exceptionHandler->register(function(HttpException $e)
41-
{
40+
$this->exceptionHandler->register(function (HttpException $e) {
4241
return new Response('foo', 404);
4342
});
4443

@@ -51,8 +50,7 @@ public function testExceptionHandlerHandlesException()
5150

5251
public function testExceptionHandlerHandlesExceptionAndCreatesNewResponse()
5352
{
54-
$this->exceptionHandler->register(function(HttpException $e)
55-
{
53+
$this->exceptionHandler->register(function (HttpException $e) {
5654
return 'foo';
5755
});
5856

tests/Routing/RouterTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
use Dingo\Api\Http\ResponseFormat\JsonResponseFormat;
1616
use Symfony\Component\HttpKernel\Exception\HttpException;
1717

18-
class RouterTest extends PHPUnit_Framework_TestCase {
19-
20-
18+
class RouterTest extends PHPUnit_Framework_TestCase
19+
{
2120
public function setUp()
2221
{
2322
$this->events = new Dispatcher;
@@ -119,7 +118,7 @@ public function testApiRouteCollectionOptionsApplyToRoutes()
119118
*/
120119
public function testRegisteringApiRouteGroupWithoutVersionThrowsException()
121120
{
122-
$this->router->api([], function(){});
121+
$this->router->api([], function () {});
123122
}
124123

125124

@@ -387,8 +386,7 @@ public function testApiCollectionsWithPointReleaseVersions()
387386
});
388387
});
389388

390-
$this->router->api(['version' => 'v2.0.1', 'prefix' => 'api'], function ()
391-
{
389+
$this->router->api(['version' => 'v2.0.1', 'prefix' => 'api'], function () {
392390
$this->router->get('bar', function () {
393391
return 'bar';
394392
});

tests/Stubs/EloquentModelStub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
use Illuminate\Database\Eloquent\Model;
66

7-
class EloquentModelStub extends Model {
8-
7+
class EloquentModelStub extends Model
8+
{
99
protected $table = 'app_user';
1010

1111
public function toArray()

0 commit comments

Comments
 (0)