@@ -88,7 +88,7 @@ |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | return $this->connections->getDefault(); |
91 | - } catch (JAQBException|PDOException $e) { |
|
91 | + } catch (JAQBException | PDOException $e) { |
|
92 | 92 | throw new DriverException($e->getMessage(), $e->getCode(), $e); |
93 | 93 | } |
94 | 94 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | /** |
173 | 173 | * Gets the model ID. |
174 | 174 | */ |
175 | - public function id(): string|int|false |
|
175 | + public function id(): string | int | false |
|
176 | 176 | { |
177 | 177 | if (!$this->hasId) { |
178 | 178 | return false; |
@@ -1308,7 +1308,7 @@ discard block |
||
1308 | 1308 | * |
1309 | 1309 | * @throws InvalidArgumentException when the relationship manager cannot be created |
1310 | 1310 | */ |
1311 | - public function relation(string $k): Model|array|null |
|
1311 | + public function relation(string $k): Model | array | null |
|
1312 | 1312 | { |
1313 | 1313 | if (!array_key_exists($k, $this->_relationships)) { |
1314 | 1314 | $relation = Relationship::make($this, static::definition()->get($k)); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | * - ['string', 'min' => '5'] |
86 | 86 | * - matching|password. |
87 | 87 | */ |
88 | - public function __construct(array|string $rules) |
|
88 | + public function __construct(array | string $rules) |
|
89 | 89 | { |
90 | 90 | // parses this format: matching|password_php |
91 | 91 | if (!is_array($rules)) { |
@@ -9,7 +9,7 @@ |
||
9 | 9 | /** |
10 | 10 | * @return Model[] |
11 | 11 | */ |
12 | - public static function hydrate(array $result, string|Model $modelClass, array $eagerLoaded): array |
|
12 | + public static function hydrate(array $result, string | Model $modelClass, array $eagerLoaded): array |
|
13 | 13 | { |
14 | 14 | $ids = []; |
15 | 15 | $eagerLoadedProperties = []; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | const DEFAULT_LIMIT = 100; |
24 | 24 | const MAX_LIMIT = 1000; |
25 | 25 | |
26 | - private Model|string $model; |
|
26 | + private Model | string $model; |
|
27 | 27 | private array $joins = []; |
28 | 28 | private array $eagerLoaded = []; |
29 | 29 | private array $where = []; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | private int $start = 0; |
32 | 32 | private array $sort = []; |
33 | 33 | |
34 | - public function __construct(Model|string $model = '') |
|
34 | + public function __construct(Model | string $model = '') |
|
35 | 35 | { |
36 | 36 | $this->model = $model; |
37 | 37 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Gets the model class associated with this query. |
41 | 41 | */ |
42 | - public function getModel(): Model|string |
|
42 | + public function getModel(): Model | string |
|
43 | 43 | { |
44 | 44 | return $this->model; |
45 | 45 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * |
90 | 90 | * @return $this |
91 | 91 | */ |
92 | - public function sort(array|string $sort): self |
|
92 | + public function sort(array | string $sort): self |
|
93 | 93 | { |
94 | 94 | $columns = explode(',', $sort); |
95 | 95 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @return $this |
139 | 139 | */ |
140 | - public function where(array|string $where, mixed $value = null, string|null $condition = null): self |
|
140 | + public function where(array | string $where, mixed $value = null, string | null $condition = null): self |
|
141 | 141 | { |
142 | 142 | // handles i. |
143 | 143 | if (is_array($where)) { |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return $this |
185 | 185 | */ |
186 | - public function join(Model|string $model, string $column, string $foreignKey, string $type = 'JOIN'): self |
|
186 | + public function join(Model | string $model, string $column, string $foreignKey, string $type = 'JOIN'): self |
|
187 | 187 | { |
188 | 188 | $join = [$model, $column, $foreignKey, $type]; |
189 | 189 | // Ensure there are no duplicate joins |
@@ -145,7 +145,7 @@ |
||
145 | 145 | /** |
146 | 146 | * Formats an incoming error message. |
147 | 147 | */ |
148 | - private function sanitize(array|string $input): Error |
|
148 | + private function sanitize(array | string $input): Error |
|
149 | 149 | { |
150 | 150 | $error = is_array($input) ? $input['error'] : $input; |
151 | 151 | $context = $input['context'] ?? []; |
@@ -21,10 +21,10 @@ |
||
21 | 21 | private int $start; |
22 | 22 | private int $pointer; |
23 | 23 | private int $limit; |
24 | - private int|bool $loadedStart = false; |
|
24 | + private int | bool $loadedStart = false; |
|
25 | 25 | /** @var T[] */ |
26 | 26 | private array $models = []; |
27 | - private int|bool $count = false; |
|
27 | + private int | bool $count = false; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @param Query<T> |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public readonly string $mutable = self::MUTABLE, |
27 | 27 | public readonly bool $null = false, |
28 | 28 | public readonly bool $required = false, |
29 | - public readonly array|string|null $validate = null, |
|
29 | + public readonly array | string | null $validate = null, |
|
30 | 30 | mixed $default = self::MISSING_DEFAULT, |
31 | 31 | public readonly bool $encrypted = false, |
32 | 32 | bool $persisted = true, |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public readonly ?string $local_key = null, |
38 | 38 | public readonly ?string $id_key = null, |
39 | 39 | public readonly ?string $pivot_tablename = null, |
40 | - public readonly ?array $morphs_to = null, |
|
40 | + public readonly ? array $morphs_to = null, |
|
41 | 41 | ?string $belongs_to = null, |
42 | 42 | ?string $belongs_to_many = null, |
43 | 43 | ?string $has_one = null, |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string $foreignModel foreign model class |
29 | 29 | * @param string $foreignKey identifying key on foreign model |
30 | 30 | */ |
31 | - public function __construct(Model $localModel, string $localKey, string $tablename, string $foreignModel, string $foreignKey, private readonly string|null $idKey) |
|
31 | + public function __construct(Model $localModel, string $localKey, string $tablename, string $foreignModel, string $foreignKey, private readonly string | null $idKey) |
|
32 | 32 | { |
33 | 33 | $this->tablename = $tablename; |
34 | 34 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $pivot->setTablename($this->tablename); |
42 | 42 | |
43 | 43 | $ids = $this->localModel->ids(); |
44 | - $ids = $this->idKey ? [$this->idKey => array_shift($ids)] : $ids ; |
|
44 | + $ids = $this->idKey ? [$this->idKey => array_shift($ids)] : $ids; |
|
45 | 45 | //known issue - this will work only on single join column |
46 | 46 | foreach ($ids as $idProperty => $id) { |
47 | 47 | if (null === $id) { |