From 8ea39d53464228033971307e3d1434bb0ab34414 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 20:46:41 +0000 Subject: [PATCH 1/6] Update Event.php --- src/Illuminate/Console/Scheduling/Event.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 5268f4f62b98..7ab1e2ac3803 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -344,6 +344,17 @@ public function hourly() return $this->spliceIntoPosition(1, 0); } + /** + * Schedule the event to run hourly at a given offset in the hour. + * + * @param string $offset + * @return $this + */ + public function hourlyAt($offset) + { + return $this->spliceIntoPosition(1, $offset); + } + /** * Schedule the event to run daily. * From d9d9f0efb58ebe93d909213b8c1102339609f6d2 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 20:50:02 +0000 Subject: [PATCH 2/6] Update ConsoleScheduledEventTest.php --- tests/Console/ConsoleScheduledEventTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Console/ConsoleScheduledEventTest.php b/tests/Console/ConsoleScheduledEventTest.php index 434d47a73b7b..72981fea5f76 100644 --- a/tests/Console/ConsoleScheduledEventTest.php +++ b/tests/Console/ConsoleScheduledEventTest.php @@ -67,6 +67,9 @@ public function testBasicCronCompilation() $event = new Event('php foo'); $this->assertEquals('0 * * * * *', $event->everyFiveMinutes()->hourly()->getExpression()); + $event = new Event('php foo'); + $this->assertEquals('37 * * * * *', $event->hourlyAt(37)->getExpression()); + $event = new Event('php foo'); $this->assertEquals('0 15 4 * * *', $event->monthlyOn(4, '15:00')->getExpression()); From e14f94c36f158fa48c8074a61c6228addaca84d3 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 20:58:30 +0000 Subject: [PATCH 3/6] Update ConsoleScheduledEventTest.php --- tests/Console/ConsoleScheduledEventTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Console/ConsoleScheduledEventTest.php b/tests/Console/ConsoleScheduledEventTest.php index 72981fea5f76..8f792358d9c2 100644 --- a/tests/Console/ConsoleScheduledEventTest.php +++ b/tests/Console/ConsoleScheduledEventTest.php @@ -69,7 +69,7 @@ public function testBasicCronCompilation() $event = new Event('php foo'); $this->assertEquals('37 * * * * *', $event->hourlyAt(37)->getExpression()); - + $event = new Event('php foo'); $this->assertEquals('0 15 4 * * *', $event->monthlyOn(4, '15:00')->getExpression()); From c901d4feda5d634fad68e0eb4008455efe4eed6f Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 20:59:03 +0000 Subject: [PATCH 4/6] Update ConsoleScheduledEventTest.php --- tests/Console/ConsoleScheduledEventTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Console/ConsoleScheduledEventTest.php b/tests/Console/ConsoleScheduledEventTest.php index 8f792358d9c2..86a0a298c7e7 100644 --- a/tests/Console/ConsoleScheduledEventTest.php +++ b/tests/Console/ConsoleScheduledEventTest.php @@ -68,7 +68,7 @@ public function testBasicCronCompilation() $this->assertEquals('0 * * * * *', $event->everyFiveMinutes()->hourly()->getExpression()); $event = new Event('php foo'); - $this->assertEquals('37 * * * * *', $event->hourlyAt(37)->getExpression()); + $this->assertEquals('37 * * * * *', $event->hourlyAt(37)->getExpression()); $event = new Event('php foo'); $this->assertEquals('0 15 4 * * *', $event->monthlyOn(4, '15:00')->getExpression()); From 4bf241a7dada73e715fe0985661dceab8cd71510 Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 20:59:52 +0000 Subject: [PATCH 5/6] Update Event.php --- src/Illuminate/Console/Scheduling/Event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 7ab1e2ac3803..b287d8fb57ac 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -344,10 +344,10 @@ public function hourly() return $this->spliceIntoPosition(1, 0); } - /** + /** * Schedule the event to run hourly at a given offset in the hour. * - * @param string $offset + * @param string $offset * @return $this */ public function hourlyAt($offset) From 2e94f20f635f914f7ef8d7e1a498fa56bf40c0cc Mon Sep 17 00:00:00 2001 From: Laurence Ioannou Date: Thu, 5 Jan 2017 21:16:33 +0000 Subject: [PATCH 6/6] Change string to int --- 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 b287d8fb57ac..47f7be90951a 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -347,7 +347,7 @@ public function hourly() /** * Schedule the event to run hourly at a given offset in the hour. * - * @param string $offset + * @param int $offset * @return $this */ public function hourlyAt($offset)