From cece7e6df4a27a5424231d966539f75ac492e0f0 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Mon, 3 Jul 2017 08:43:59 +0200 Subject: [PATCH 1/3] Remove useless variables. --- src/Illuminate/Console/Scheduling/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 816e56b15fd2..2c06bd902fc9 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -633,7 +633,7 @@ public function getSummaryForDisplay() */ public function nextRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false) { - return Carbon::instance($nextDue = CronExpression::factory( + return Carbon::instance(CronExpression::factory( $this->getExpression() )->getNextRunDate($currentTime, $nth, $allowCurrentDate)); } From 05d60f632670eb4390ccc5f0a842f689afdaf2a9 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Mon, 3 Jul 2017 08:57:11 +0200 Subject: [PATCH 2/3] Remove useless variables. --- tests/Routing/RoutingRouteTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Routing/RoutingRouteTest.php b/tests/Routing/RoutingRouteTest.php index 56a8841f10d3..59204a783cf5 100644 --- a/tests/Routing/RoutingRouteTest.php +++ b/tests/Routing/RoutingRouteTest.php @@ -40,17 +40,17 @@ public function testBasicDispatchingOfRoutes() $this->assertEquals('hello', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent()); $router = $this->getRouter(); - $route = $router->get('foo/bar', ['domain' => 'api.{name}.bar', function ($name) { + $router->get('foo/bar', ['domain' => 'api.{name}.bar', function ($name) { return $name; }]); - $route = $router->get('foo/bar', ['domain' => 'api.{name}.baz', function ($name) { + $router->get('foo/bar', ['domain' => 'api.{name}.baz', function ($name) { return $name; }]); $this->assertEquals('taylor', $router->dispatch(Request::create('http://api.taylor.bar/foo/bar', 'GET'))->getContent()); $this->assertEquals('dayle', $router->dispatch(Request::create('http://api.dayle.baz/foo/bar', 'GET'))->getContent()); $router = $this->getRouter(); - $route = $router->get('foo/{age}', ['domain' => 'api.{name}.bar', function ($name, $age) { + $router->get('foo/{age}', ['domain' => 'api.{name}.bar', function ($name, $age) { return $name.$age; }]); $this->assertEquals('taylor25', $router->dispatch(Request::create('http://api.taylor.bar/foo/25', 'GET'))->getContent()); @@ -110,7 +110,7 @@ public function testBasicDispatchingOfRoutes() $this->assertFalse($router->is('bar')); $router = $this->getRouter(); - $route = $router->get('foo/{file}', function ($file) { + $router->get('foo/{file}', function ($file) { return $file; }); $this->assertEquals('oxygen%20', $router->dispatch(Request::create('http://test.com/foo/oxygen%2520', 'GET'))->getContent()); @@ -497,7 +497,7 @@ public function testRoutesDontMatchNonMatchingPathsWithLeadingOptionals() public function testRoutesDontMatchNonMatchingDomain() { $router = $this->getRouter(); - $route = $router->get('foo/bar', ['domain' => 'api.foo.bar', function () { + $router->get('foo/bar', ['domain' => 'api.foo.bar', function () { return 'hello'; }]); $this->assertEquals('hello', $router->dispatch(Request::create('http://api.baz.boom/foo/bar', 'GET'))->getContent()); @@ -506,7 +506,7 @@ public function testRoutesDontMatchNonMatchingDomain() public function testRouteDomainRegistration() { $router = $this->getRouter(); - $route = $router->get('/foo/bar')->domain('api.foo.bar')->uses(function () { + $router->get('/foo/bar')->domain('api.foo.bar')->uses(function () { return 'hello'; }); $this->assertEquals('hello', $router->dispatch(Request::create('http://api.foo.bar/foo/bar', 'GET'))->getContent()); From 8d82c56ba7dbc337ba5224b6c549ed0e1e147175 Mon Sep 17 00:00:00 2001 From: Lucas Michot Date: Mon, 3 Jul 2017 08:58:42 +0200 Subject: [PATCH 3/3] Fix style. --- tests/Routing/RoutingRouteTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/Routing/RoutingRouteTest.php b/tests/Routing/RoutingRouteTest.php index 59204a783cf5..85ae6867d96b 100644 --- a/tests/Routing/RoutingRouteTest.php +++ b/tests/Routing/RoutingRouteTest.php @@ -40,17 +40,17 @@ public function testBasicDispatchingOfRoutes() $this->assertEquals('hello', $router->dispatch(Request::create('foo/bar', 'GET'))->getContent()); $router = $this->getRouter(); - $router->get('foo/bar', ['domain' => 'api.{name}.bar', function ($name) { + $router->get('foo/bar', ['domain' => 'api.{name}.bar', function ($name) { return $name; }]); - $router->get('foo/bar', ['domain' => 'api.{name}.baz', function ($name) { + $router->get('foo/bar', ['domain' => 'api.{name}.baz', function ($name) { return $name; }]); $this->assertEquals('taylor', $router->dispatch(Request::create('http://api.taylor.bar/foo/bar', 'GET'))->getContent()); $this->assertEquals('dayle', $router->dispatch(Request::create('http://api.dayle.baz/foo/bar', 'GET'))->getContent()); $router = $this->getRouter(); - $router->get('foo/{age}', ['domain' => 'api.{name}.bar', function ($name, $age) { + $router->get('foo/{age}', ['domain' => 'api.{name}.bar', function ($name, $age) { return $name.$age; }]); $this->assertEquals('taylor25', $router->dispatch(Request::create('http://api.taylor.bar/foo/25', 'GET'))->getContent()); @@ -110,7 +110,7 @@ public function testBasicDispatchingOfRoutes() $this->assertFalse($router->is('bar')); $router = $this->getRouter(); - $router->get('foo/{file}', function ($file) { + $router->get('foo/{file}', function ($file) { return $file; }); $this->assertEquals('oxygen%20', $router->dispatch(Request::create('http://test.com/foo/oxygen%2520', 'GET'))->getContent()); @@ -497,7 +497,7 @@ public function testRoutesDontMatchNonMatchingPathsWithLeadingOptionals() public function testRoutesDontMatchNonMatchingDomain() { $router = $this->getRouter(); - $router->get('foo/bar', ['domain' => 'api.foo.bar', function () { + $router->get('foo/bar', ['domain' => 'api.foo.bar', function () { return 'hello'; }]); $this->assertEquals('hello', $router->dispatch(Request::create('http://api.baz.boom/foo/bar', 'GET'))->getContent()); @@ -506,7 +506,7 @@ public function testRoutesDontMatchNonMatchingDomain() public function testRouteDomainRegistration() { $router = $this->getRouter(); - $router->get('/foo/bar')->domain('api.foo.bar')->uses(function () { + $router->get('/foo/bar')->domain('api.foo.bar')->uses(function () { return 'hello'; }); $this->assertEquals('hello', $router->dispatch(Request::create('http://api.foo.bar/foo/bar', 'GET'))->getContent());