Skip to content

Commit 1171c69

Browse files
committed
Add Pint
Signed-off-by: Pushpak Chhajed <[email protected]>
1 parent d33a84f commit 1171c69

34 files changed

+159
-357
lines changed

all.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function packages(): \Laravel\Roster\PackageCollection
3232
$packageName = basename($dir);
3333

3434
// Skip special directories handled elsewhere in GuidelineComposer
35-
if (in_array($packageName, ['boost', 'herd'])) {
35+
if (in_array($packageName, ['boost', 'herd'], true)) {
3636
continue;
3737
}
3838

@@ -88,10 +88,10 @@ public function packages(): \Laravel\Roster\PackageCollection
8888
}
8989
};
9090

91-
$herd = new Herd();
91+
$herd = new Herd;
9292

9393
// Create GuidelineComposer with all config options enabled to get ALL guidelines
94-
$config = new GuidelineConfig();
94+
$config = new GuidelineConfig;
9595
$config->laravelStyle = true;
9696
$config->hasAnApi = true;
9797
$config->caresAboutLocalization = true;

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@
5353
"scripts": {
5454
"lint": [
5555
"vendor/bin/pint",
56-
"vendor/bin/phpstan"
56+
"vendor/bin/phpstan --memory-limit=-1"
5757
],
5858
"test": [
5959
"vendor/bin/pest"
6060
],
61+
"test:lint": "pint --test",
62+
"test:types": "phpstan",
6163
"check": [
6264
"@composer lint",
6365
"@composer test"

pint.json

Lines changed: 12 additions & 206 deletions
Original file line numberDiff line numberDiff line change
@@ -1,212 +1,18 @@
11
{
2-
"preset": "empty",
2+
"preset": "laravel",
33
"rules": {
4-
"align_multiline_comment": true,
5-
"array_indentation": true,
6-
"array_syntax": {
7-
"syntax": "short"
4+
"global_namespace_import": {
5+
"import_classes": true,
6+
"import_constants": true
87
},
9-
"binary_operator_spaces": {
10-
"default": "single_space"
11-
},
12-
"blank_line_after_namespace": true,
13-
"blank_line_after_opening_tag": true,
14-
"blank_line_before_statement": {
15-
"statements": [
16-
"return"
17-
]
18-
},
19-
"blank_line_between_import_groups": true,
20-
"blank_lines_before_namespace": true,
21-
"braces_position": {
22-
"control_structures_opening_brace": "same_line",
23-
"functions_opening_brace": "next_line_unless_newline_at_signature_end",
24-
"anonymous_functions_opening_brace": "same_line",
25-
"classes_opening_brace": "next_line_unless_newline_at_signature_end",
26-
"anonymous_classes_opening_brace": "next_line_unless_newline_at_signature_end",
27-
"allow_single_line_empty_anonymous_classes": false,
28-
"allow_single_line_anonymous_functions": false
29-
},
30-
"cast_spaces": true,
31-
"class_definition": true,
32-
"class_reference_name_casing": true,
33-
"clean_namespace": true,
34-
"compact_nullable_type_declaration": true,
35-
"concat_space": true,
36-
"constant_case": {
37-
"case": "lower"
38-
},
39-
"control_structure_braces": true,
40-
"declare_equal_normalize": true,
41-
"elseif": true,
42-
"encoding": true,
8+
"phpdoc_types": false,
9+
"combine_consecutive_issets": true,
10+
"combine_consecutive_unsets": true,
4311
"explicit_string_variable": true,
44-
"full_opening_tag": true,
45-
"function_declaration": true,
46-
"heredoc_to_nowdoc": true,
47-
"include": true,
48-
"increment_style": {
49-
"style": "post"
50-
},
51-
"indentation_type": true,
52-
"integer_literal_case": true,
53-
"lambda_not_used_import": true,
54-
"line_ending": true,
55-
"list_syntax": {
56-
"syntax": "short"
57-
},
58-
"lowercase_cast": true,
59-
"lowercase_keywords": true,
60-
"lowercase_static_reference": true,
61-
"magic_constant_casing": true,
62-
"magic_method_casing": true,
63-
"method_argument_space": {
64-
"on_multiline": "ignore"
65-
},
6612
"method_chaining_indentation": true,
67-
"multiline_whitespace_before_semicolons": {
68-
"strategy": "no_multi_line"
69-
},
70-
"native_function_casing": true,
71-
"native_type_declaration_casing": true,
72-
"no_alternative_syntax": true,
73-
"no_binary_string": true,
74-
"no_blank_lines_after_class_opening": true,
75-
"no_blank_lines_after_phpdoc": true,
76-
"no_closing_tag": true,
77-
"no_empty_phpdoc": true,
78-
"no_empty_statement": true,
79-
"no_extra_blank_lines": {
80-
"tokens": [
81-
"extra",
82-
"throw",
83-
"use"
84-
]
85-
},
86-
"no_leading_import_slash": true,
87-
"no_leading_namespace_whitespace": true,
88-
"no_mixed_echo_print": {
89-
"use": "echo"
90-
},
91-
"no_multiline_whitespace_around_double_arrow": true,
92-
"no_short_bool_cast": true,
93-
"no_singleline_whitespace_before_semicolons": true,
94-
"no_space_around_double_colon": true,
95-
"no_spaces_around_offset": {
96-
"positions": [
97-
"inside",
98-
"outside"
99-
]
100-
},
101-
"no_spaces_after_function_name": true,
102-
"no_trailing_comma_in_singleline": true,
103-
"no_trailing_whitespace": true,
104-
"no_trailing_whitespace_in_comment": true,
105-
"no_unneeded_braces": true,
106-
"no_unneeded_control_parentheses": true,
107-
"no_unneeded_import_alias": true,
108-
"no_unset_cast": true,
109-
"no_unused_imports": true,
110-
"no_useless_return": true,
111-
"no_whitespace_before_comma_in_array": true,
112-
"no_whitespace_in_blank_line": true,
113-
"normalize_index_brace": true,
114-
"not_operator_with_successor_space": true,
115-
"nullable_type_declaration_for_default_null_value": true,
116-
"object_operator_without_whitespace": true,
117-
"ordered_imports": {
118-
"sort_algorithm": "alpha",
119-
"imports_order": [
120-
"const",
121-
"class",
122-
"function"
123-
]
124-
},
125-
"phpdoc_align": {
126-
"align": "left",
127-
"spacing": {
128-
"param": 1
129-
}
130-
},
131-
"phpdoc_indent": true,
132-
"phpdoc_inline_tag_normalizer": true,
133-
"phpdoc_no_access": true,
134-
"phpdoc_no_package": true,
135-
"phpdoc_no_useless_inheritdoc": true,
136-
"phpdoc_order": {
137-
"order": [
138-
"param",
139-
"return",
140-
"throws"
141-
]
142-
},
143-
"phpdoc_return_self_reference": true,
144-
"phpdoc_scalar": true,
145-
"phpdoc_separation": {
146-
"groups": [
147-
[
148-
"deprecated",
149-
"link",
150-
"see",
151-
"since"
152-
],
153-
[
154-
"author",
155-
"copyright",
156-
"license"
157-
],
158-
[
159-
"category",
160-
"package",
161-
"subpackage"
162-
],
163-
[
164-
"property",
165-
"property-read",
166-
"property-write"
167-
],
168-
[
169-
"param",
170-
"return"
171-
]
172-
]
173-
},
174-
"phpdoc_single_line_var_spacing": true,
175-
"phpdoc_summary": true,
176-
"phpdoc_trim": true,
177-
"phpdoc_types": true,
178-
"phpdoc_var_without_name": true,
179-
"return_type_declaration": {
180-
"space_before": "none"
181-
},
182-
"short_scalar_cast": true,
183-
"single_blank_line_at_eof": true,
184-
"single_class_element_per_statement": true,
185-
"single_import_per_statement": true,
186-
"single_line_after_imports": true,
187-
"single_line_comment_style": true,
188-
"single_quote": true,
189-
"space_after_semicolon": true,
190-
"spaces_inside_parentheses": true,
191-
"standardize_not_equals": true,
192-
"switch_case_semicolon_to_colon": true,
193-
"switch_case_space": true,
194-
"switch_continue_to_break": true,
195-
"ternary_operator_spaces": true,
196-
"trailing_comma_in_multiline": true,
197-
"trim_array_spaces": true,
198-
"type_declaration_spaces": true,
199-
"types_spaces": true,
200-
"unary_operator_spaces": true,
201-
"visibility_required": {
202-
"elements": [
203-
"method",
204-
"property"
205-
]
206-
},
207-
"whitespace_after_comma_in_array": true
208-
},
209-
"notPath": [
210-
"stubs/tool.stub.php"
211-
]
13+
"no_binary_string": false,
14+
"strict_comparison": true,
15+
"strict_param": true,
16+
"ternary_to_null_coalescing": true
17+
}
21218
}

src/Concerns/MakesHttpRequests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function get(string $url): Response
3030
}
3131

3232
/**
33-
* @param array<string, mixed> $json
33+
* @param array<string, mixed> $json
3434
*/
3535
public function json(string $url, array $json): Response
3636
{

src/Console/ExecuteToolCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function handle(): int
3232
}
3333

3434
// Decode arguments
35-
$arguments = json_decode(base64_decode($argumentsEncoded), true);
35+
$arguments = json_decode(base64_decode($argumentsEncoded, true), true);
3636
if (json_last_error() !== JSON_ERROR_NONE) {
3737
$this->error('Invalid arguments format: '.json_last_error_msg());
3838

src/Contracts/Agent.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ interface Agent
1111
{
1212
/**
1313
* Get the display name of the Agent.
14-
*
15-
* @return string|null
1614
*/
1715
public function agentName(): ?string;
1816

@@ -25,8 +23,6 @@ public function guidelinesPath(): string;
2523

2624
/**
2725
* Determine if the guideline file requires frontmatter.
28-
*
29-
* @return bool
3026
*/
3127
public function frontmatter(): bool;
3228
}

src/Contracts/McpClient.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ interface McpClient
1111
{
1212
/**
1313
* Get the display name of the MCP (Model Context Protocol) client.
14-
*
15-
* @return string|null
1614
*/
1715
public function mcpClientName(): ?string;
1816

@@ -34,10 +32,10 @@ public function getArtisanPath(): string;
3432
/**
3533
* Install an MCP server configuration in this IDE.
3634
*
37-
* @param string $key Server identifier/name
38-
* @param string $command Executable command to run the MCP server
39-
* @param array<int, string> $args Command line arguments
40-
* @param array<string, string> $env Environment variables
35+
* @param string $key Server identifier/name
36+
* @param string $command Executable command to run the MCP server
37+
* @param array<int, string> $args Command line arguments
38+
* @param array<string, string> $env Environment variables
4139
* @return bool True if installation succeeded, false otherwise
4240
*/
4341
public function installMcp(string $key, string $command, array $args = [], array $env = []): bool;

src/Install/Assists/Inertia.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
class Inertia
1111
{
12-
public function __construct(private Roster $roster)
13-
{
14-
}
12+
public function __construct(private Roster $roster) {}
1513

1614
public function gte(string $version): bool
1715
{

0 commit comments

Comments
 (0)