File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Bridge/Laravel/Console/Commands Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public function handle(ConfigRepository $config): int
22
22
$ collection = $ this ->argument ('collection ' );
23
23
$ collectionExists = $ config ->collections ()->has ($ collection );
24
24
25
- if (false === $ collectionExists ) {
25
+ if ($ collectionExists === false ) {
26
26
$ this ->error ('Collection " ' . $ collection . '" does not exist. ' );
27
27
28
28
return self ::FAILURE ;
Original file line number Diff line number Diff line change @@ -21,15 +21,26 @@ final class Config implements ConfigRepository
21
21
];
22
22
23
23
private readonly bool $ onFly ;
24
+
24
25
private readonly array $ frontend ;
25
26
26
27
private readonly Collection $ collections ;
27
28
29
+ public function __construct (
30
+ bool $ onFly ,
31
+ array $ frontend ,
32
+ array $ collections ,
33
+ ) {
34
+ $ this ->onFly = $ onFly ;
35
+ $ this ->frontend = $ frontend ;
36
+ $ this ->collections = new Collection ($ collections );
37
+ }
38
+
28
39
public static function fromArray (array $ config ): self
29
40
{
30
41
$ missingAttributes = array_diff (self ::REQUIRED_FIELDS , array_keys ($ config ));
31
42
32
- if ([] !== $ missingAttributes ) {
43
+ if ($ missingAttributes !== [] ) {
33
44
throw MissingRequiredAttributes::fromArray (
34
45
implode (', ' , $ missingAttributes )
35
46
);
@@ -42,16 +53,6 @@ public static function fromArray(array $config): self
42
53
);
43
54
}
44
55
45
- public function __construct (
46
- bool $ onFly ,
47
- array $ frontend ,
48
- array $ collections ,
49
- ) {
50
- $ this ->onFly = $ onFly ;
51
- $ this ->frontend = $ frontend ;
52
- $ this ->collections = new Collection ($ collections );
53
- }
54
-
55
56
public function onFly (): bool
56
57
{
57
58
return $ this ->onFly ;
You can’t perform that action at this time.
0 commit comments