Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit fb35d6d

Browse files
committed
apply new styling
1 parent 1914192 commit fb35d6d

8 files changed

+47
-23
lines changed

src/LoopFunctionServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class LoopFunctionServiceProvider extends PackageServiceProvider
1212
/**
1313
* Configure the package.
1414
*
15-
* @param Package $package
15+
* @param Package $package
1616
*
1717
* @return void
1818
*/

src/Traits/HelpsLoopFunctions.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ trait HelpsLoopFunctions
99
/**
1010
* Assign the value to the property or rescue.
1111
*
12-
* @param int|string $key
13-
* @param mixed $value
14-
* @param mixed|null $rescue
12+
* @param int|string $key
13+
* @param mixed $value
14+
* @param mixed|null $rescue
1515
*
1616
* @return void
1717
* @throws \ReflectionException
@@ -28,7 +28,7 @@ private function assignValue(int|string $key, mixed $value, mixed $rescue = null
2828
}
2929

3030
/**
31-
* @param int|string $key
31+
* @param int|string $key
3232
*
3333
* @return bool
3434
* @throws \ReflectionException
@@ -41,7 +41,7 @@ private function canAssignValue(int|string $key): bool
4141
}
4242

4343
/**
44-
* @param int|string $key
44+
* @param int|string $key
4545
*
4646
* @return bool
4747
*/
@@ -55,7 +55,7 @@ private function checksPropertyExists(int|string $key): bool
5555
}
5656

5757
/**
58-
* @param int|string $key
58+
* @param int|string $key
5959
*
6060
* @return bool
6161
* @throws \ReflectionException
@@ -69,7 +69,7 @@ private function hasDefaultValue(int|string $key): bool
6969
}
7070

7171
/**
72-
* @param mixed $value
72+
* @param mixed $value
7373
*
7474
* @return bool
7575
*/

src/Traits/LoopFunctions.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ trait LoopFunctions
1414
/**
1515
* Choose proper strategy to loop over the data.
1616
*
17-
* @param Model|\ArrayAccess|array|null $data
18-
* @param mixed|null $rescue
17+
* @param Model|\ArrayAccess|array|null $data
18+
* @param mixed|null $rescue
1919
*
2020
* @return void
2121
*/
@@ -32,8 +32,8 @@ public function propertiesFrom(Model|\ArrayAccess|array|null $data = null, mixed
3232
/**
3333
* Maps your model attributes to local class properties.
3434
*
35-
* @param Model|null $model
36-
* @param mixed $rescue
35+
* @param Model|null $model
36+
* @param mixed $rescue
3737
*
3838
* @return void
3939
*/
@@ -53,8 +53,8 @@ public function attributesToProperties(?Model $model = null, mixed $rescue = nul
5353
/**
5454
* Map array data to class properties.
5555
*
56-
* @param array|\ArrayAccess|null $data
57-
* @param mixed|null $rescue
56+
* @param array|\ArrayAccess|null $data
57+
* @param mixed|null $rescue
5858
*
5959
* @return void
6060
*/
@@ -74,9 +74,9 @@ public function arrayToProperties(array|\ArrayAccess|null $data, mixed $rescue =
7474
/**
7575
* Dump class properties as key-valued array.
7676
*
77-
* @param string|object|null $class
78-
* @param int|null $filter
79-
* @param bool $asCollection
77+
* @param string|object|null $class
78+
* @param int|null $filter
79+
* @param bool $asCollection
8080
*
8181
* @return array|Collection
8282
* @throws \ReflectionException

src/Traits/WithDynamicProperties.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
trait WithDynamicProperties
66
{
77
/**
8-
* @param string $name
8+
* @param string $name
99
*
1010
* @return mixed
1111
*/
@@ -15,8 +15,8 @@ public function __get(string $name): mixed
1515
}
1616

1717
/**
18-
* @param string $name
19-
* @param mixed $value
18+
* @param string $name
19+
* @param mixed $value
2020
*
2121
* @return void
2222
*/

tests/ArrayMappingTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ class ArrayMappingTest extends TestCase
1111
use LoopFunctions;
1212

1313
public bool $test = false;
14+
1415
public ?string $name = null;
16+
1517
public ?string $password = null;
18+
1619
public ?array $additional_data = [];
20+
1721
public ?array $array = [];
22+
1823
public ?Collection $supportCollection = null;
24+
1925
public ?EloquentCollection $eloquentCollection = null;
2026

2127
public function setUp(): void
@@ -76,7 +82,6 @@ public function testAlreadyInitializedPropertiesArentOverridenByNestedArrays()
7682
],
7783
];
7884

79-
8085
$this->arrayToProperties($array);
8186

8287
$this->assertStringContainsString('Michael', $this->name);

tests/AttributeMappingTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ class AttributeMappingTest extends TestCase
1111
use LoopFunctions;
1212

1313
public int $id;
14+
1415
public bool $test;
16+
1517
public string $name;
18+
1619
public string $password;
20+
1721
public object $files;
1822

19-
public ?\Closure $default = null;
20-
public ?Collection $collection = null;
23+
public ?\Closure $default = null;
24+
25+
public ?Collection $collection = null;
26+
2127
public ?string $intAsString = null;
2228

2329
/** @test */

tests/Boilerplate/TestClass.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,25 @@ class TestClass
1010
use LoopFunctions;
1111

1212
public bool $bool = false;
13+
1314
public string $string = 'string';
15+
1416
public ?string $nullable_string = 'string';
17+
1518
public array $array = [];
19+
1620
public ?array $nullable_array = [];
1721

1822
protected Collection $collection;
23+
1924
protected ?Collection $nullable_collection = null;
2025

2126
private static array $static = [];
27+
2228
private static ?array $nullable_static_array = null;
2329

2430
protected string|array|null $union_type = ['test' => false];
31+
2532
protected static string|array|null $static_union_type = 'test';
2633

2734
public function __construct()

tests/RecursiveArrayMappingTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ class RecursiveArrayMappingTest extends TestCase
1010
use LoopFunctions;
1111

1212
public bool $test = false;
13+
1314
public ?string $nice = 'no';
15+
1416
public ?string $first_name = null;
17+
1518
public ?string $last_name = null;
19+
1620
public ?string $full_name = null;
21+
1722
public ?array $array = null;
23+
1824
public ?Collection $collection = null;
1925

2026
/** @test */

0 commit comments

Comments
 (0)