diff --git a/src/Generator.php b/src/Generator.php index 7579a02..d6327f1 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -84,6 +84,7 @@ public function toExpression(): string public function setExpresion(Expression $expression): self { $this->expression = $expression; + return $this; } diff --git a/src/Traits/Years.php b/src/Traits/Years.php index e057f27..ec95e90 100644 --- a/src/Traits/Years.php +++ b/src/Traits/Years.php @@ -4,8 +4,6 @@ namespace Butschster\CronExpression\Traits; -use Cron\CronExpression; - trait Years { public function months(string | int ...$months): self diff --git a/tests/GeneratorTest.php b/tests/GeneratorTest.php index 813eb82..17fbdf2 100644 --- a/tests/GeneratorTest.php +++ b/tests/GeneratorTest.php @@ -74,10 +74,10 @@ public function testEveryXHours() public function testSetsHours() { - $this->assertExpression('* 1,2,3 * * *', $this->generator->hours(1,2,3)); + $this->assertExpression('* 1,2,3 * * *', $this->generator->hours(1, 2, 3)); $this->assertExpression('* */3 * * *', $this->generator->hours('*/3')); - $this->assertExpression('15 1,2,3 * * *', $this->generator->hourlyAt(15)->hours(1,2,3)); + $this->assertExpression('15 1,2,3 * * *', $this->generator->hourlyAt(15)->hours(1, 2, 3)); } public function testInvalidHoursShouldThrowAnException()