Skip to content

Commit b5df599

Browse files
committed
chore: styling
1 parent 5af781b commit b5df599

32 files changed

+388
-137
lines changed

pint.json

Lines changed: 227 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,236 @@
11
{
2-
"preset": "laravel",
2+
"preset": "psr12",
3+
"exclude": ["tests/Commands/__snapshots__/files"],
34
"rules": {
5+
"align_multiline_comment": true,
6+
"array_indentation": true,
7+
"array_push": true,
8+
"array_syntax": true,
9+
"assign_null_coalescing_to_coalesce_equal": true,
10+
"attribute_empty_parentheses": true,
11+
"binary_operator_spaces": true,
12+
"blank_line_after_namespace": true,
13+
"blank_line_after_opening_tag": true,
414
"blank_line_before_statement": true,
5-
"concat_space": {
6-
"spacing": "one"
15+
"blank_line_between_import_groups": true,
16+
"blank_lines_before_namespace": true,
17+
"braces_position": true,
18+
"cast_spaces": true,
19+
"class_attributes_separation": true,
20+
"class_definition": {
21+
"space_before_parenthesis": true
722
},
23+
"class_keyword": true,
24+
"class_reference_name_casing": true,
25+
"clean_namespace": true,
26+
"combine_consecutive_issets": true,
27+
"combine_consecutive_unsets": true,
28+
"combine_nested_dirname": true,
29+
"comment_to_phpdoc": true,
30+
"compact_nullable_type_declaration": true,
31+
"concat_space": true,
32+
"constant_case": true,
33+
"control_structure_braces": true,
34+
"control_structure_continuation_position": true,
35+
"date_time_immutable": true,
36+
"declare_equal_normalize": true,
37+
"declare_parentheses": true,
38+
"declare_strict_types": true,
39+
"dir_constant": true,
40+
"echo_tag_syntax": true,
41+
"elseif": true,
42+
"empty_loop_body": true,
43+
"empty_loop_condition": true,
44+
"encoding": true,
45+
"explicit_indirect_variable": true,
46+
"explicit_string_variable": true,
47+
"final_class": true,
48+
"fopen_flag_order": true,
49+
"fopen_flags": true,
50+
"full_opening_tag": true,
51+
"fully_qualified_strict_types": true,
52+
"function_declaration": true,
53+
"function_to_constant": true,
54+
"general_phpdoc_tag_rename": true,
55+
"get_class_to_class_keyword": true,
56+
"heredoc_closing_marker": true,
57+
"heredoc_to_nowdoc": true,
58+
"include": true,
59+
"indentation_type": true,
60+
"integer_literal_case": true,
61+
"is_null": true,
62+
"lambda_not_used_import": true,
63+
"line_ending": true,
64+
"linebreak_after_opening_tag": true,
65+
"list_syntax": true,
66+
"logical_operators": true,
67+
"lowercase_cast": true,
68+
"lowercase_keywords": true,
69+
"lowercase_static_reference": true,
70+
"magic_constant_casing": true,
71+
"magic_method_casing": true,
72+
"mb_str_functions": true,
873
"method_argument_space": true,
74+
"method_chaining_indentation": true,
75+
"modernize_strpos": true,
76+
"modernize_types_casting": true,
77+
"multiline_comment_opening_closing": true,
78+
"multiline_whitespace_before_semicolons": true,
79+
"native_constant_invocation": true,
80+
"native_function_casing": true,
81+
"native_function_invocation": true,
82+
"native_function_type_declaration_casing": true,
83+
"new_with_braces": true,
84+
"no_alias_functions": true,
85+
"no_alias_language_construct_call": true,
86+
"no_alternative_syntax": true,
87+
"no_blank_lines_after_class_opening": true,
88+
"no_blank_lines_after_phpdoc": true,
89+
"no_break_comment": true,
90+
"no_closing_tag": true,
91+
"no_empty_comment": true,
92+
"no_empty_phpdoc": true,
93+
"no_empty_statement": true,
94+
"no_extra_blank_lines": true,
95+
"no_leading_import_slash": true,
96+
"no_leading_namespace_whitespace": true,
97+
"no_mixed_echo_print": true,
98+
"no_multiline_whitespace_around_double_arrow": true,
99+
"no_multiple_statements_per_line": true,
100+
"no_null_property_initialization": true,
101+
"no_short_bool_cast": true,
102+
"no_singleline_whitespace_before_semicolons": true,
103+
"no_space_around_double_colon": true,
104+
"no_spaces_after_function_name": true,
105+
"no_spaces_around_offset": true,
106+
"no_spaces_inside_parenthesis": true,
107+
"no_superfluous_elseif": true,
108+
"no_superfluous_phpdoc_tags": true,
109+
"no_trailing_comma_in_singleline": true,
110+
"no_trailing_whitespace": true,
111+
"no_trailing_whitespace_in_comment": true,
112+
"no_trailing_whitespace_in_string": true,
113+
"no_unneeded_control_parentheses": true,
114+
"no_unneeded_curly_braces": true,
115+
"no_unneeded_final_method": true,
116+
"no_unneeded_import_alias": true,
117+
"no_unreachable_default_argument_value": true,
118+
"no_unset_cast": true,
119+
"no_unset_on_property": true,
120+
"no_unused_imports": true,
121+
"no_useless_concat_operator": true,
122+
"no_useless_else": true,
123+
"no_useless_nullsafe_operator": true,
124+
"no_useless_return": true,
125+
"no_useless_sprintf": true,
126+
"no_whitespace_before_comma_in_array": true,
127+
"no_whitespace_in_blank_line": true,
128+
"normalize_index_brace": true,
129+
"not_operator_with_successor_space": true,
130+
"nullable_type_declaration_for_default_null_value": true,
131+
"object_operator_without_whitespace": true,
132+
"operator_linebreak": true,
133+
"ordered_class_elements": true,
134+
"ordered_imports": true,
135+
"ordered_interfaces": true,
136+
"ordered_traits": true,
137+
"php_unit_construct": true,
138+
"php_unit_fqcn_annotation": true,
139+
"php_unit_internal_class": true,
140+
"php_unit_method_casing": {
141+
"case": "snake_case"
142+
},
143+
"php_unit_set_up_tear_down_visibility": true,
144+
"php_unit_size_class": true,
145+
"php_unit_strict": true,
146+
"php_unit_test_annotation": true,
147+
"php_unit_test_case_static_method_calls": {
148+
"call_type": "this"
149+
},
150+
"phpdoc_add_missing_param_annotation": true,
151+
"phpdoc_annotation_without_dot": true,
152+
"phpdoc_indent": true,
153+
"phpdoc_inline_tag_normalizer": true,
154+
"phpdoc_line_span": true,
155+
"phpdoc_no_empty_return": true,
156+
"phpdoc_no_useless_inheritdoc": true,
157+
"phpdoc_order": true,
158+
"phpdoc_order_by_value": true,
159+
"phpdoc_return_self_reference": true,
160+
"phpdoc_scalar": true,
161+
"phpdoc_separation": true,
162+
"phpdoc_single_line_var_spacing": true,
163+
"phpdoc_summary": true,
164+
"phpdoc_tag_casing": true,
165+
"phpdoc_tag_type": true,
166+
"phpdoc_to_comment": true,
167+
"phpdoc_to_param_type": true,
168+
"phpdoc_to_property_type": true,
169+
"phpdoc_to_return_type": true,
170+
"phpdoc_trim": true,
171+
"phpdoc_trim_consecutive_blank_line_separation": true,
172+
"phpdoc_types": true,
173+
"phpdoc_types_order": true,
174+
"phpdoc_var_annotation_correct_order": true,
175+
"phpdoc_var_without_name": true,
176+
"pow_to_exponentiation": true,
177+
"protected_to_private": true,
178+
"regular_callable_call": true,
179+
"return_assignment": true,
180+
"self_accessor": true,
181+
"self_static_accessor": true,
182+
"semicolon_after_instruction": true,
183+
"set_type_to_cast": true,
184+
"short_scalar_cast": true,
185+
"simple_to_complex_string_variable": true,
186+
"simplified_if_return": true,
187+
"simplified_null_return": true,
188+
"single_blank_line_at_eof": true,
189+
"single_class_element_per_statement": true,
190+
"single_import_per_statement": true,
191+
"single_line_after_imports": true,
192+
"single_line_comment_spacing": true,
193+
"single_line_comment_style": true,
194+
"single_line_empty_body": true,
195+
"single_line_throw": true,
196+
"single_quote": true,
197+
"single_space_after_construct": true,
198+
"single_space_around_construct": true,
9199
"single_trait_insert_per_statement": true,
200+
"space_after_semicolon": true,
201+
"spaces_inside_parentheses": true,
202+
"standardize_increment": true,
203+
"standardize_not_equals": true,
204+
"statement_indentation": true,
205+
"static_lambda": true,
206+
"strict_comparison": true,
207+
"strict_param": true,
208+
"string_length_to_empty": true,
209+
"string_line_ending": true,
210+
"switch_case_semicolon_to_colon": true,
211+
"switch_case_space": true,
212+
"switch_continue_to_break": true,
213+
"ternary_operator_spaces": true,
214+
"ternary_to_null_coalescing": true,
215+
"trailing_comma_in_multiline": {
216+
"after_heredoc": true,
217+
"elements": [
218+
"arguments",
219+
"arrays",
220+
"match",
221+
"parameters"
222+
]
223+
},
224+
"trim_array_spaces": true,
225+
"type_declaration_spaces": true,
10226
"types_spaces": {
11-
"space": "single"
12-
}
227+
"space": "single",
228+
"space_multiple_catch": "single"
229+
},
230+
"unary_operator_spaces": true,
231+
"use_arrow_functions": true,
232+
"visibility_required": true,
233+
"void_return": true,
234+
"whitespace_after_comma_in_array": true
13235
}
14236
}

src/AndSpecification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ final class AndSpecification extends CompositeSpecification
1616
*/
1717
public function __construct(
1818
private readonly array $specifications,
19-
) {
20-
}
19+
) {}
2120

2221
public function isSatisfiedBy(mixed $candidate): bool
2322
{

src/Commands/MakeSpecificationCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ protected function getStub(): string
3333
}
3434

3535
/**
36-
* {@inheritDoc}
36+
* @inheritDoc
3737
*/
3838
protected function getDefaultNamespace(mixed $rootNamespace): string
3939
{
4040
return sprintf('%s\Specifications', $rootNamespace);
4141
}
4242

4343
/**
44-
* {@inheritDoc}
44+
* @inheritDoc
4545
*/
4646
protected function buildClass(mixed $name): string
4747
{
@@ -85,7 +85,7 @@ protected function getOptions(): array
8585
protected function resolveStubPath(string $stub): string
8686
{
8787
$custom = $this->laravel->basePath(trim($stub, '/'));
88-
$default = __DIR__ . $stub;
88+
$default = __DIR__.$stub;
8989

9090
return file_exists($custom) ? $custom : $default;
9191
}

src/CompositeSpecification.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,69 +14,75 @@ abstract class CompositeSpecification implements Specification
1414
/**
1515
* @return CompositeSpecification<TCandidate>
1616
*/
17-
public function not(): CompositeSpecification
17+
public function not(): self
1818
{
1919
return new NotSpecification($this);
2020
}
2121

2222
/**
2323
* @param Specification<TCandidate> $specification
24+
*
2425
* @return CompositeSpecification<TCandidate>
2526
*/
26-
public function or(Specification $specification): CompositeSpecification
27+
public function or(Specification $specification): self
2728
{
2829
return new OrSpecification([$this, $specification]);
2930
}
3031

3132
/**
3233
* @param Specification<TCandidate> $specification
34+
*
3335
* @return CompositeSpecification<TCandidate>
3436
*/
35-
public function orNot(Specification $specification): CompositeSpecification
37+
public function orNot(Specification $specification): self
3638
{
3739
return $this->or(new NotSpecification($specification));
3840
}
3941

4042
/**
4143
* @param Specification<TCandidate> $specification
44+
*
4245
* @return CompositeSpecification<TCandidate>
4346
*/
44-
public function xor(Specification $specification): CompositeSpecification
47+
public function xor(Specification $specification): self
4548
{
4649
return new XorSpecification([$this, $specification]);
4750
}
4851

4952
/**
5053
* @param Specification<TCandidate> $specification
54+
*
5155
* @return CompositeSpecification<TCandidate>
5256
*/
53-
public function xorNot(Specification $specification): CompositeSpecification
57+
public function xorNot(Specification $specification): self
5458
{
5559
return $this->xor(new NotSpecification($specification));
5660
}
5761

5862
/**
5963
* @param Specification<TCandidate> $specification
64+
*
6065
* @return CompositeSpecification<TCandidate>
6166
*/
62-
public function and(Specification $specification): CompositeSpecification
67+
public function and(Specification $specification): self
6368
{
6469
return new AndSpecification([$this, $specification]);
6570
}
6671

6772
/**
6873
* @param Specification<TCandidate> $specification
74+
*
6975
* @return CompositeSpecification<TCandidate>
7076
*/
71-
public function andNot(Specification $specification): CompositeSpecification
77+
public function andNot(Specification $specification): self
7278
{
7379
return $this->and(new NotSpecification($specification));
7480
}
7581

7682
/**
7783
* @return CompositeSpecification<TCandidate>
7884
*/
79-
public function verbose(string $message = ''): CompositeSpecification
85+
public function verbose(string $message = ''): self
8086
{
8187
return new VerboseSpecification($this, $message);
8288
}

src/DissatisfiedSpecification.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use DomainException;
88

9-
final class DissatisfiedSpecification extends DomainException
10-
{
11-
}
9+
final class DissatisfiedSpecification extends DomainException {}

src/Laravel/CollectionMatchingMacro.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ final class CollectionMatchingMacro
1818
{
1919
public function __invoke(): Closure
2020
{
21-
return function (Specification $specification) {
22-
return $this->filter(
23-
static function (mixed $candidate) use ($specification): bool {
24-
return $specification->isSatisfiedBy($candidate);
25-
},
26-
);
27-
};
21+
return fn (Specification $specification) => $this->filter(
22+
static fn (mixed $candidate): bool => $specification->isSatisfiedBy($candidate),
23+
);
2824
}
2925
}

src/NotSpecification.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ final class NotSpecification extends CompositeSpecification
1616
*/
1717
public function __construct(
1818
private readonly Specification $specification,
19-
) {
20-
}
19+
) {}
2120

2221
public function isSatisfiedBy(mixed $candidate): bool
2322
{

0 commit comments

Comments
 (0)