@@ -42,7 +42,9 @@ discard block |
||
42 | 42 | |
43 | 43 | foreach ($list as $item) { |
44 | 44 | $obj = ObjectFactory::make($this->getClient(), $item); |
45 | - if (!$obj) continue; |
|
45 | + if (!$obj) { |
|
46 | + continue; |
|
47 | + } |
|
46 | 48 | |
47 | 49 | $this->_items[] = $obj; |
48 | 50 | } |
@@ -76,6 +78,8 @@ discard block |
||
76 | 78 | */ |
77 | 79 | public function first(): ?Model |
78 | 80 | { |
79 | - foreach ($this as $obj) return $obj; |
|
81 | + foreach ($this as $obj) { |
|
82 | + return $obj; |
|
83 | + } |
|
80 | 84 | } |
81 | 85 | } |
@@ -6,7 +6,9 @@ |
||
6 | 6 | */ |
7 | 7 | function lifeboat_date_formatter(string $date) |
8 | 8 | { |
9 | - if (!$date) return null; |
|
9 | + if (!$date) { |
|
10 | + return null; |
|
11 | + } |
|
10 | 12 | |
11 | 13 | try { |
12 | 14 | $date = new \DateTime($date . ' CET'); |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | public static function create(Connector $connector, string $model, array $data = []): Model |
22 | 22 | { |
23 | 23 | $model = strtolower($model); |
24 | - if (!array_key_exists($model, ClassMap::MODELS)) return new LifeboatModel($connector, $data); |
|
24 | + if (!array_key_exists($model, ClassMap::MODELS)) { |
|
25 | + return new LifeboatModel($connector, $data); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | $cls = ClassMap::MODELS[$model]; |
27 | 29 | return new $cls($connector, $data); |
@@ -35,7 +37,9 @@ discard block |
||
35 | 37 | public static function make(Connector $connector, array $data): Model |
36 | 38 | { |
37 | 39 | $model = $data['model'] ?? ''; |
38 | - if (!$model) return new LifeboatModel($connector, $data); |
|
40 | + if (!$model) { |
|
41 | + return new LifeboatModel($connector, $data); |
|
42 | + } |
|
39 | 43 | return self::create($connector, $model, $data); |
40 | 44 | } |
41 | 45 | } |