Skip to content

Commit 9a2e7e2

Browse files
Style fixes
1 parent 87b7117 commit 9a2e7e2

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/Illuminate/Database/Eloquent/Casts/AsCollectionMap.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function get($model, $key, $value, $attributes)
3535

3636
$data = Json::decode($attributes[$key]);
3737

38-
if (!is_array($data)) {
38+
if (! is_array($data)) {
3939
return null;
4040
}
4141

@@ -79,8 +79,8 @@ public static function into($class)
7979
/**
8080
* Specify the callable to map each item in the Collection cast.
8181
*
82-
* @param callable-string|array{0: class-string, 1: string} $callback
83-
* @param string|null $method
82+
* @param callable-string|array{0: class-string, 1: string} $callback
83+
* @param string|null $method
8484
* @return string
8585
*/
8686
public static function using($callback, $method = null)
@@ -96,6 +96,5 @@ public static function using($callback, $method = null)
9696
return $method === null
9797
? static::class.':'.$callback
9898
: static::class.':'.$callback.'@'.$method;
99-
10099
}
101100
}

src/Illuminate/Database/Eloquent/Casts/AsEncryptedCollectionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function get($model, $key, $value, $attributes)
3434

3535
$data = Json::decode(Crypt::decryptString($attributes[$key]));
3636

37-
if (!is_array($data)) {
37+
if (! is_array($data)) {
3838
return null;
3939
}
4040

tests/Integration/Database/DatabaseCustomCastsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ public function test_custom_casting_map_into_collection(): void
162162
$model->mergeCasts(['collection' => AsCollectionMap::into(Fluent::class)]);
163163
$model->fill([
164164
'collection' => [
165-
['name' => 'Taylor']
166-
]
165+
['name' => 'Taylor'],
166+
],
167167
]);
168168

169169
$fluent = $model->collection->first();
@@ -177,7 +177,7 @@ public static function provideMapArguments()
177177
return [
178178
[TestCollectionMapCallable::class],
179179
[TestCollectionMapCallable::class, 'make'],
180-
[TestCollectionMapCallable::class . '@' .'make'],
180+
[TestCollectionMapCallable::class.'@'.'make'],
181181
];
182182
}
183183

@@ -188,8 +188,8 @@ public function test_custom_casting_map_collection($class, $method = null): void
188188
$model->mergeCasts(['collection' => AsCollectionMap::using($class, $method)]);
189189
$model->fill([
190190
'collection' => [
191-
['name' => 'Taylor']
192-
]
191+
['name' => 'Taylor'],
192+
],
193193
]);
194194

195195
$result = $model->collection->first();
@@ -204,8 +204,8 @@ public function test_custom_casting_map_collection_throw_when_no_arguments(): vo
204204
$model->mergeCasts(['collection' => AsCollectionMap::class]);
205205
$model->fill([
206206
'collection' => [
207-
['name' => 'Taylor']
208-
]
207+
['name' => 'Taylor'],
208+
],
209209
]);
210210

211211
$this->expectException(InvalidArgumentException::class);

0 commit comments

Comments
 (0)