Skip to content

Commit b3e3fab

Browse files
committed
Modernize code
1 parent 16b57db commit b3e3fab

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Laravel/ZodiacServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ public function boot()
3434
*/
3535
public function register()
3636
{
37-
$this->app->singleton('zodiac', function (Application $app) {
38-
return new ZodiacBridge($app);
39-
});
37+
$this->app->singleton('zodiac', fn(Application $app): ZodiacBridge => new ZodiacBridge($app));
4038
}
4139

4240
/**

src/ZodiacComparableDate.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
use Intervention\Zodiac\Exceptions\RuntimeException;
1010
use Intervention\Zodiac\Interfaces\ZodiacInterface;
1111
use Intervention\Zodiac\Zodiacs\Capricorn;
12+
use Stringable;
1213

13-
class ZodiacComparableDate
14+
class ZodiacComparableDate implements Stringable
1415
{
1516
/**
1617
* Create new instance
@@ -60,7 +61,11 @@ public function isZodiac(ZodiacInterface $zodiac): bool
6061
->addDay()
6162
];
6263

63-
return ($this->date->between(...$period1) || $this->date->between(...$period2));
64+
if ($this->date->between(...$period1)) {
65+
return true;
66+
}
67+
68+
return $this->date->between(...$period2);
6469
}
6570

6671
return $this->date->between(

0 commit comments

Comments
 (0)