Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit f0106de

Browse files
committed
🧹 Fixed code-style
1 parent 1cf90df commit f0106de

File tree

7 files changed

+5
-52
lines changed

7 files changed

+5
-52
lines changed

‎composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"allow-plugins": {
7070
"dragon-code/codestyler": true,
7171
"ergebnis/composer-normalize": true,
72-
"friendsofphp/php-cs-fixer": true
72+
"friendsofphp/php-cs-fixer": true,
73+
"symfony/thanks": true
7374
},
7475
"preferred-install": "dist",
7576
"sort-packages": true

‎src/Concerns/From.php

-16
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,15 @@
1515
trait From
1616
{
1717
/**
18-
* @param array $array
19-
*
2018
* @throws ReflectionException
21-
*
22-
* @return \DragonCode\Contracts\DataTransferObject\DataTransferObject
2319
*/
2420
public static function fromArray(array $array): Contract
2521
{
2622
return new static($array);
2723
}
2824

2925
/**
30-
* @param $object
31-
*
3226
* @throws ReflectionException
33-
*
34-
* @return \DragonCode\Contracts\DataTransferObject\DataTransferObject
3527
*/
3628
public static function fromObject($object): Contract
3729
{
@@ -41,11 +33,7 @@ public static function fromObject($object): Contract
4133
}
4234

4335
/**
44-
* @param \Symfony\Component\HttpFoundation\Request $request
45-
*
4636
* @throws ReflectionException
47-
*
48-
* @return \DragonCode\Contracts\DataTransferObject\DataTransferObject
4937
*/
5038
public static function fromRequest(Request $request): Contract
5139
{
@@ -55,11 +43,7 @@ public static function fromRequest(Request $request): Contract
5543
}
5644

5745
/**
58-
* @param string $json
59-
*
6046
* @throws ReflectionException
61-
*
62-
* @return \DragonCode\Contracts\DataTransferObject\DataTransferObject
6347
*/
6448
public static function fromJson(string $json): Contract
6549
{

‎src/Concerns/Reflection.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ protected function reflection(): ReflectionClass
2121
}
2222

2323
/**
24-
* @param $object
25-
*
2624
* @throws ReflectionException
2725
*
28-
* @return ReflectionProperty[]
26+
* @return array<ReflectionProperty>
2927
*/
3028
protected function reflectProperties($object): array
3129
{
@@ -35,11 +33,7 @@ protected function reflectProperties($object): array
3533
}
3634

3735
/**
38-
* @param $object
39-
*
4036
* @throws ReflectionException
41-
*
42-
* @return array
4337
*/
4438
protected function getProperties($object): array
4539
{

‎src/Converters/Objects.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
class Objects implements Arrayable
1616
{
1717
use Makeable;
18-
1918
use Reflection;
2019

2120
protected $object;

‎src/DataTransferObject.php

-25
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@
2121
abstract class DataTransferObject implements Contract
2222
{
2323
use Castable;
24-
2524
use From;
26-
2725
use Makeable;
28-
2926
use Reflection;
30-
3127
use To;
3228

3329
protected const DISALLOW = ['map', 'only', 'except'];
@@ -39,8 +35,6 @@ abstract class DataTransferObject implements Contract
3935
protected $except = [];
4036

4137
/**
42-
* @param array $items
43-
*
4438
* @throws ReflectionException
4539
*/
4640
public function __construct(array $items = [])
@@ -69,8 +63,6 @@ public function set(string $key, $value): DataTransferObject
6963
}
7064

7165
/**
72-
* @param array $items
73-
*
7466
* @throws ReflectionException
7567
*
7668
* @return \DragonCode\SimpleDataTransferObject\DataTransferObject
@@ -87,8 +79,6 @@ public function merge(array $items): DataTransferObject
8779

8880
/**
8981
* @throws ReflectionException
90-
*
91-
* @return array
9282
*/
9383
public function toArray(): array
9484
{
@@ -121,8 +111,6 @@ protected function filterExcept(array $items): array
121111
}
122112

123113
/**
124-
* @param array $items
125-
*
126114
* @throws ReflectionException
127115
*/
128116
protected function setMap(array $items): void
@@ -139,8 +127,6 @@ protected function setMap(array $items): void
139127
}
140128

141129
/**
142-
* @param array $items
143-
*
144130
* @throws ReflectionException
145131
*/
146132
protected function setItems(array $items): void
@@ -160,9 +146,6 @@ protected function getValueByKey(array $items, string $key, string $default)
160146
}
161147

162148
/**
163-
* @param string $key
164-
* @param mixed $value
165-
*
166149
* @throws ReflectionException
167150
*/
168151
protected function setValue(string $key, $value): void
@@ -173,23 +156,15 @@ protected function setValue(string $key, $value): void
173156
}
174157

175158
/**
176-
* @param string $key
177-
*
178159
* @throws ReflectionException
179-
*
180-
* @return bool
181160
*/
182161
protected function isAllow(string $key): bool
183162
{
184163
return $this->isAllowKey($key) && $this->isAllowProperty($key);
185164
}
186165

187166
/**
188-
* @param string $key
189-
*
190167
* @throws ReflectionException
191-
*
192-
* @return bool
193168
*/
194169
protected function isAllowProperty(string $key): bool
195170
{

‎tests/Fixtures/Nested/Company.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Company extends DataTransferObject
1010
{
1111
public $title;
1212

13-
/** @var \Tests\Fixtures\Nested\Project[] */
13+
/** @var array<\Tests\Fixtures\Nested\Project> */
1414
public $projects;
1515

1616
protected function castProjects(array $projects): array

‎tests/Fixtures/Nested/Project.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Project extends DataTransferObject
1212

1313
public $domain;
1414

15-
/** @var \Tests\Fixtures\Nested\Developer[] */
15+
/** @var array<\Tests\Fixtures\Nested\Developer> */
1616
public $developers;
1717

1818
protected function castDevelopers(array $developers): array

0 commit comments

Comments
 (0)