22
33namespace Myerscode \Laravel \DomainValidator ;
44
5+ use Override ;
56use Closure ;
67use Illuminate \Support \Facades \Validator ;
78use Illuminate \Support \ServiceProvider as BaseServiceProvider ;
@@ -18,41 +19,30 @@ class ServiceProvider extends BaseServiceProvider
1819{
1920 /**
2021 * Register any application services.
21- *
22- * @return void
2322 */
23+ #[Override]
2424 public function register (): void
2525 {
2626 $ this ->registerConfig ();
2727
2828 $ this ->registerLanguage ();
2929
30- $ this ->app ->singleton ('ldv.factory ' , function () {
31- return new RulesFactory ;
32- });
30+ $ this ->app ->singleton ('ldv.factory ' , fn (): RulesFactory => new RulesFactory );
3331
34- $ this ->app ->singleton ('ldv.rules ' , function ($ app ) {
35- return $ app ->make ('ldv.factory ' )->createPublicSuffixRules ();
36- });
32+ $ this ->app ->singleton ('ldv.rules ' , fn ($ app ) => $ app ->make ('ldv.factory ' )->createPublicSuffixRules ());
3733
38- $ this ->app ->singleton ('ldv.tld ' , function ($ app ) {
39- return $ app ->make ('ldv.factory ' )->createTopLevelDomains ();
40- });
34+ $ this ->app ->singleton ('ldv.tld ' , fn ($ app ) => $ app ->make ('ldv.factory ' )->createTopLevelDomains ());
4135
42- $ this ->app ->singleton ('ldv.suffix ' , function ($ app ) {
43- return new class {
44- public function __call ($ method , $ parameters )
45- {
46- return Suffix::$ method (...$ parameters );
47- }
48- };
36+ $ this ->app ->singleton ('ldv.suffix ' , fn ($ app ): object => new class {
37+ public function __call (string $ method , array $ parameters )
38+ {
39+ return Suffix::$ method (...$ parameters );
40+ }
4941 });
5042 }
5143
5244 /**
5345 * Bootstrap any application services.
54- *
55- * @return void
5646 */
5747 public function boot (): void
5848 {
0 commit comments