Skip to content

Commit b212669

Browse files
authored
Merge pull request #5 from laravel/feat/improve_pint_config
config: update pint.json to use laravel pckage rules
2 parents 9ed4002 + d543320 commit b212669

File tree

10 files changed

+196
-22
lines changed

10 files changed

+196
-22
lines changed

pint.json

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

src/BoostServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function boot(Router $router): void
5555
return;
5656
}
5757

58-
/* @phpstan-ignore-next-line */
58+
// @phpstan-ignore-next-line
5959
Mcp::local('laravel-boost', Boost::class);
6060

6161
$this->registerPublishing();

src/Install/GuidelineComposer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function config(GuidelineConfig $config): self
3232
}
3333

3434
/**
35-
* Auto discovers the guideline files and composes them into one string
35+
* Auto discovers the guideline files and composes them into one string.
3636
*/
3737
public function compose(): string
3838
{
@@ -62,7 +62,7 @@ public function guidelines(): Collection
6262
}
6363

6464
/**
65-
* Key is the 'guideline key' and value is the rendered blade
65+
* Key is the 'guideline key' and value is the rendered blade.
6666
*
6767
* @return \Illuminate\Support\Collection<string, string>
6868
*/

src/Install/GuidelineWriter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class GuidelineWriter
1616

1717
public const NOOP = 3;
1818

19-
public function __construct(protected Agent $agent) {}
19+
public function __construct(protected Agent $agent)
20+
{
21+
}
2022

2123
/**
2224
* @return \Laravel\Boost\Install\GuidelineWriter::NEW|\Laravel\Boost\Install\GuidelineWriter::REPLACED|\Laravel\Boost\Install\GuidelineWriter::FAILED|\Laravel\Boost\Install\GuidelineWriter::NOOP

src/Mcp/Resources/ApplicationInfo.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
class ApplicationInfo extends Resource
1212
{
13-
public function __construct(protected ToolExecutor $toolExecutor) {}
13+
public function __construct(protected ToolExecutor $toolExecutor)
14+
{
15+
}
1416

1517
public function description(): string
1618
{

src/Mcp/ToolExecutor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct()
1717
}
1818

1919
/**
20-
* Execute a tool with the given arguments
20+
* Execute a tool with the given arguments.
2121
*
2222
* @param array<string, mixed> $arguments
2323
*/
@@ -35,7 +35,7 @@ public function execute(string $toolClass, array $arguments = []): ToolResult
3535
}
3636

3737
/**
38-
* Execute tool in a separate process for isolation
38+
* Execute tool in a separate process for isolation.
3939
*
4040
* @param array<string, mixed> $arguments
4141
*/
@@ -78,7 +78,7 @@ protected function executeInProcess(string $toolClass, array $arguments): ToolRe
7878
}
7979

8080
/**
81-
* Execute tool inline (current process)
81+
* Execute tool inline (current process).
8282
*
8383
* @param array<string, mixed> $arguments
8484
*/
@@ -94,7 +94,7 @@ protected function executeInline(string $toolClass, array $arguments): ToolResul
9494
}
9595

9696
/**
97-
* Check if process isolation should be used
97+
* Check if process isolation should be used.
9898
*/
9999
protected function shouldUseProcessIsolation(): bool
100100
{
@@ -107,15 +107,15 @@ protected function shouldUseProcessIsolation(): bool
107107
}
108108

109109
/**
110-
* Get the execution timeout
110+
* Get the execution timeout.
111111
*/
112112
protected function getTimeout(): int
113113
{
114114
return config('boost.process_isolation.timeout', 180);
115115
}
116116

117117
/**
118-
* Reconstruct a ToolResult from JSON data
118+
* Reconstruct a ToolResult from JSON data.
119119
*
120120
* @param array<string, mixed> $data
121121
*/

src/Mcp/ToolRegistry.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ToolRegistry
1010
private static ?array $cachedTools = null;
1111

1212
/**
13-
* Get all available tools based on the discovery logic from Boost server
13+
* Get all available tools based on the discovery logic from Boost server.
1414
*
1515
* @return array<int, class-string>
1616
*/
@@ -49,23 +49,23 @@ public static function getAvailableTools(): array
4949
}
5050

5151
/**
52-
* Check if a tool class is allowed to be executed
52+
* Check if a tool class is allowed to be executed.
5353
*/
5454
public static function isToolAllowed(string $toolClass): bool
5555
{
5656
return in_array($toolClass, self::getAvailableTools(), true);
5757
}
5858

5959
/**
60-
* Clear the cached tools (useful for testing or when configuration changes)
60+
* Clear the cached tools (useful for testing or when configuration changes).
6161
*/
6262
public static function clearCache(): void
6363
{
6464
self::$cachedTools = null;
6565
}
6666

6767
/**
68-
* Get tool names (class basenames) mapped to their full class names
68+
* Get tool names (class basenames) mapped to their full class names.
6969
*
7070
* @return array<string, class-string>
7171
*/

src/Mcp/Tools/ApplicationInfo.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
#[IsReadOnly]
1818
class ApplicationInfo extends Tool
1919
{
20-
public function __construct(protected Roster $roster) {}
20+
public function __construct(protected Roster $roster)
21+
{
22+
}
2123

2224
public function description(): string
2325
{
@@ -44,7 +46,7 @@ public function handle(array $arguments): ToolResult
4446
}
4547

4648
/**
47-
* Discover all Eloquent models in the application
49+
* Discover all Eloquent models in the application.
4850
*
4951
* @return array<string, string>
5052
*/

src/Mcp/Tools/SearchDocs.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ class SearchDocs extends Tool
1616
{
1717
use MakesHttpRequests;
1818

19-
public function __construct(protected Roster $roster) {}
19+
public function __construct(protected Roster $roster)
20+
{
21+
}
2022

2123
public function description(): string
2224
{

tests/Feature/Mcp/Tools/BrowserLogsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@
9797

9898
test('@boostJs blade directive renders browser logger script', function () {
9999
// Ensure route exists
100-
Route::post('/_boost/browser-logs', function () {})->name('boost.browser-logs');
100+
Route::post('/_boost/browser-logs', function () {
101+
})->name('boost.browser-logs');
101102

102103
$blade = Blade::compileString('@boostJs');
103104

0 commit comments

Comments
 (0)