Skip to content

Commit 2538e9e

Browse files
committed
style: explicit string variables, interpolation curly braces
1 parent d656a6f commit 2538e9e

File tree

8 files changed

+64
-23
lines changed

8 files changed

+64
-23
lines changed

pint.json

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"blank_line_after_namespace": true,
1313
"blank_line_after_opening_tag": true,
1414
"blank_line_before_statement": {
15-
"statements": ["return"]
15+
"statements": [
16+
"return"
17+
]
1618
},
1719
"blank_line_between_import_groups": true,
1820
"blank_lines_before_namespace": true,
@@ -38,6 +40,7 @@
3840
"declare_equal_normalize": true,
3941
"elseif": true,
4042
"encoding": true,
43+
"explicit_string_variable": true,
4144
"full_opening_tag": true,
4245
"function_declaration": true,
4346
"heredoc_to_nowdoc": true,
@@ -74,7 +77,11 @@
7477
"no_empty_phpdoc": true,
7578
"no_empty_statement": true,
7679
"no_extra_blank_lines": {
77-
"tokens": ["extra", "throw", "use"]
80+
"tokens": [
81+
"extra",
82+
"throw",
83+
"use"
84+
]
7885
},
7986
"no_leading_import_slash": true,
8087
"no_leading_namespace_whitespace": true,
@@ -86,7 +93,10 @@
8693
"no_singleline_whitespace_before_semicolons": true,
8794
"no_space_around_double_colon": true,
8895
"no_spaces_around_offset": {
89-
"positions": ["inside", "outside"]
96+
"positions": [
97+
"inside",
98+
"outside"
99+
]
90100
},
91101
"no_spaces_after_function_name": true,
92102
"no_trailing_comma_in_singleline": true,
@@ -106,7 +116,11 @@
106116
"object_operator_without_whitespace": true,
107117
"ordered_imports": {
108118
"sort_algorithm": "alpha",
109-
"imports_order": ["const", "class", "function"]
119+
"imports_order": [
120+
"const",
121+
"class",
122+
"function"
123+
]
110124
},
111125
"phpdoc_align": {
112126
"align": "left",
@@ -120,17 +134,41 @@
120134
"phpdoc_no_package": true,
121135
"phpdoc_no_useless_inheritdoc": true,
122136
"phpdoc_order": {
123-
"order": ["param", "return", "throws"]
137+
"order": [
138+
"param",
139+
"return",
140+
"throws"
141+
]
124142
},
125143
"phpdoc_return_self_reference": true,
126144
"phpdoc_scalar": true,
127145
"phpdoc_separation": {
128146
"groups": [
129-
["deprecated", "link", "see", "since"],
130-
["author", "copyright", "license"],
131-
["category", "package", "subpackage"],
132-
["property", "property-read", "property-write"],
133-
["param", "return"]
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+
]
134172
]
135173
},
136174
"phpdoc_single_line_var_spacing": true,
@@ -161,11 +199,14 @@
161199
"types_spaces": true,
162200
"unary_operator_spaces": true,
163201
"visibility_required": {
164-
"elements": ["method", "property"]
202+
"elements": [
203+
"method",
204+
"property"
205+
]
165206
},
166207
"whitespace_after_comma_in_array": true
167208
},
168-
"notPath" :[
209+
"notPath": [
169210
"stubs/tool.stub.php"
170211
]
171212
}

src/Console/InstallCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private function outro(): void
194194

195195
private function hyperlink(string $label, string $url): string
196196
{
197-
return "\033]8;;$url\007$label\033]8;;\033\\";
197+
return "\033]8;;{$url}\007{$label}\033]8;;\033\\";
198198
}
199199

200200
/**
@@ -428,7 +428,7 @@ protected function enactGuidelines(): void
428428
foreach ($this->selectedTargetAgents as $agent) {
429429
$agentName = class_basename($agent);
430430
$displayAgentName = str_pad($agentName, $longestAgentName);
431-
$this->output->write(" $displayAgentName... ");
431+
$this->output->write(" {$displayAgentName}... ");
432432

433433
try {
434434
(new GuidelineWriter($agent))
@@ -449,7 +449,7 @@ protected function enactGuidelines(): void
449449
count($failed) === 1 ? '' : 's'
450450
));
451451
foreach ($failed as $agentName => $error) {
452-
$this->line(" - $agentName: $error");
452+
$this->line(" - {$agentName}: {$error}");
453453
}
454454
}
455455
}
@@ -488,7 +488,7 @@ private function enactMcpServers(): void
488488
foreach ($this->selectedTargetIdes as $ide) {
489489
$ideName = class_basename($ide);
490490
$ideDisplay = str_pad($ideName, $longestIdeName);
491-
$this->output->write(" $ideDisplay... ");
491+
$this->output->write(" {$ideDisplay}... ");
492492
$results = [];
493493

494494
// Install Laravel Boost MCP if enabled
@@ -539,7 +539,7 @@ private function enactMcpServers(): void
539539
$this->error(sprintf('%s Some MCP servers failed to install:', $this->redCross));
540540
foreach ($failed as $ideName => $errors) {
541541
foreach ($errors as $server => $error) {
542-
$this->line(" - $ideName ($server): $error");
542+
$this->line(" - {$ideName} ({$server}): {$error}");
543543
}
544544
}
545545
}

src/Mcp/Tools/DatabaseSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function handle(array $arguments): ToolResult
4444
{
4545
$connection = $arguments['database'] ?? config('database.default');
4646
$filter = $arguments['filter'] ?? '';
47-
$cacheKey = "boost:mcp:database-schema:$connection:$filter";
47+
$cacheKey = "boost:mcp:database-schema:{$connection}:{$filter}";
4848

4949
$schema = Cache::remember($cacheKey, 20, function () use ($connection, $filter) {
5050
return $this->getDatabaseStructure($connection, $filter);

src/Mcp/Tools/GetConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function handle(array $arguments): ToolResult
3434
$key = $arguments['key'];
3535

3636
if (! Config::has($key)) {
37-
return ToolResult::error("Config key '$key' not found.");
37+
return ToolResult::error("Config key '{$key}' not found.");
3838
}
3939

4040
return ToolResult::json([

src/Mcp/Tools/LastError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function handle(array $arguments): ToolResult
7373
$logFile = $this->resolveLogFilePath();
7474

7575
if (! file_exists($logFile)) {
76-
return ToolResult::error("Log file not found at $logFile");
76+
return ToolResult::error("Log file not found at {$logFile}");
7777
}
7878

7979
$entry = $this->readLastErrorEntry($logFile);

src/Mcp/Tools/ListAvailableEnvVars.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function handle(array $arguments): ToolResult
4141
}
4242

4343
if (! file_exists($filePath)) {
44-
return ToolResult::error("File not found at '$filePath'");
44+
return ToolResult::error("File not found at '{$filePath}'");
4545
}
4646

4747
$envLines = file_get_contents($filePath);

src/Mcp/Tools/ReadLogEntries.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function handle(array $arguments): ToolResult
4444
$logFile = $this->resolveLogFilePath();
4545

4646
if (! file_exists($logFile)) {
47-
return ToolResult::error("Log file not found at $logFile");
47+
return ToolResult::error("Log file not found at {$logFile}");
4848
}
4949

5050
$entries = $this->readLastLogEntries($logFile, $maxEntries);

tests/Unit/Install/GuidelineWriterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258

259259
// Create a process that holds the lock
260260
$lockingProcess = proc_open("php -r \"
261-
\$handle = fopen('$tempFile', 'c+');
261+
\$handle = fopen('{$tempFile}', 'c+');
262262
flock(\$handle, LOCK_EX);
263263
sleep(1);
264264
fclose(\$handle);

0 commit comments

Comments
 (0)