Skip to content

Commit 0da6269

Browse files
committed
style: update pint settings and apply styles
1 parent 8b5d5bb commit 0da6269

File tree

4 files changed

+32
-37
lines changed

4 files changed

+32
-37
lines changed

pint.json

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
11
{
22
"preset": "psr12",
33
"rules": {
4+
"array_syntax": true,
5+
"assign_null_coalescing_to_coalesce_equal": true,
6+
"clean_namespace": true,
47
"declare_strict_types": true,
8+
"list_syntax": true,
9+
"no_empty_phpdoc": true,
10+
"no_superfluous_elseif": true,
11+
"no_superfluous_phpdoc_tags": {
12+
"remove_inheritdoc": true
13+
},
14+
"no_unneeded_braces": true,
15+
"no_useless_nullsafe_operator": true,
16+
"no_whitespace_before_comma_in_array": true,
17+
"normalize_index_brace": true,
18+
"nullable_type_declaration": true,
19+
"nullable_type_declaration_for_default_null_value": true,
20+
"ordered_attributes": true,
21+
"ordered_traits": true,
22+
"ordered_types": {
23+
"null_adjustment": "always_last"
24+
},
25+
"phpdoc_summary": true,
26+
"phpdoc_trim": true,
27+
"phpdoc_types": true,
28+
"phpdoc_types_order": {
29+
"null_adjustment": "always_last"
30+
},
31+
"simple_to_complex_string_variable": true,
32+
"ternary_to_null_coalescing": true,
533
"trailing_comma_in_multiline": {
634
"elements": ["arguments", "arrays", "match", "parameters"]
7-
},
8-
"nullable_type_declaration": true
9-
},
10-
"notPath": [
11-
"tests/Unit/Domain/TestReadOnlyEntity.php"
12-
]
13-
}
35+
}
36+
}
37+
}

src/AbstractValue.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,11 @@
2323

2424
/**
2525
* Is the supplied scalar value acceptable for this value class?
26-
*
27-
* @param mixed $value
28-
* @return bool
2926
*/
3027
abstract protected function accept(mixed $value): bool;
3128

3229
/**
3330
* Fluent constructor.
34-
*
35-
* @param mixed $value
36-
* @return static
3731
*/
3832
public static function create(mixed $value): static
3933
{
@@ -42,9 +36,6 @@ public static function create(mixed $value): static
4236

4337
/**
4438
* Create a value.
45-
*
46-
* @param mixed $value
47-
* @return static
4839
*/
4940
public static function from(mixed $value): static
5041
{
@@ -57,9 +48,6 @@ public static function from(mixed $value): static
5748

5849
/**
5950
* Create a value if it is acceptable, otherwise return null.
60-
*
61-
* @param mixed $value
62-
* @return static|null
6351
*/
6452
public static function tryFrom(mixed $value): ?static
6553
{
@@ -76,9 +64,6 @@ public static function tryFrom(mixed $value): ?static
7664

7765
/**
7866
* Backward compatibility method for casting values.
79-
*
80-
* @param mixed $value
81-
* @return static
8267
*/
8368
public static function cast(mixed $value): static
8469
{
@@ -89,7 +74,6 @@ public static function cast(mixed $value): static
8974
* Cast the provided value if it is not null.
9075
*
9176
* @param mixed|null $value
92-
* @return static|null
9377
*/
9478
public static function nullable(mixed $value): ?static
9579
{
@@ -103,7 +87,6 @@ public static function nullable(mixed $value): ?static
10387
/**
10488
* AbstractValue constructor.
10589
*
106-
* @param mixed $value
10790
* @throws ValueException
10891
*/
10992
final public function __construct(mixed $value)
@@ -119,9 +102,6 @@ final public function __construct(mixed $value)
119102

120103
/**
121104
* Allow the value to be parsed before it is accepted.
122-
*
123-
* @param mixed $value
124-
* @return mixed
125105
*/
126106
protected function parse(mixed $value): mixed
127107
{
@@ -130,9 +110,6 @@ protected function parse(mixed $value): mixed
130110

131111
/**
132112
* Is the value not acceptable?
133-
*
134-
* @param mixed $value
135-
* @return bool
136113
*/
137114
protected function notAcceptable(mixed $value): bool
138115
{

src/ValueInterface.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ interface ValueInterface extends JsonSerializable, Stringable
2323
{
2424
/**
2525
* Fluent string method.
26-
*
27-
* @return string
2826
*/
2927
public function toString(): string;
3028

@@ -36,8 +34,6 @@ public function get(): mixed;
3634
/**
3735
* Is the value any of the provided values?
3836
*
39-
* @param mixed ...$values
40-
* @return bool
4137
* @throws BadMethodCallException if invoked without any values.
4238
*/
4339
public function is(mixed ...$values): bool;

src/ValueTrait.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ public function get(): mixed
5252

5353
/**
5454
* Is the value any of the provided values?
55-
*
56-
* @param mixed ...$values
5755
*/
58-
public function is(...$values): bool
56+
public function is(mixed ...$values): bool
5957
{
6058
if (count($values) === 0) {
6159
throw new BadMethodCallException('Values must be provided.');

0 commit comments

Comments
 (0)