Skip to content

Commit 1223699

Browse files
committed
Merge branch 'main' into art-doco
2 parents 60851d7 + 6b990fc commit 1223699

29 files changed

+750
-449
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ jobs:
7474
tools: composer:v2
7575
coverage: none
7676

77+
- name: Setup SSH Keys
78+
run: |
79+
mkdir -p ~/.ssh
80+
echo "${{ secrets.MCP_DEPLOY_KEY }}" > ~/.ssh/id_rsa
81+
chmod 600 ~/.ssh/id_rsa
82+
ssh-keyscan github.com >> ~/.ssh/known_hosts
83+
7784
- name: Install dependencies
7885
run: |
7986
composer update --prefer-dist --no-interaction --no-progress --with="illuminate/contracts:^${{ matrix.laravel }}"

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
],
2121
"require": {
2222
"php": "^8.1|^8.2",
23+
"guzzlehttp/guzzle": "^7.9",
2324
"illuminate/console": "^10.0|^11.0|^12.0",
2425
"illuminate/contracts": "^10.0|^11.0|^12.0",
2526
"illuminate/routing": "^10.0|^11.0|^12.0",

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/BoostServiceProvider.php

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
88
use Illuminate\Http\Request;
9+
use Illuminate\Log\Logger;
910
use Illuminate\Routing\Router;
1011
use Illuminate\Support\Facades\Log;
1112
use Illuminate\Support\Facades\Route;
@@ -69,7 +70,7 @@ public function boot(Router $router): void
6970
$this->hookIntoResponses($router);
7071
}
7172

72-
protected function registerPublishing(): void
73+
private function registerPublishing(): void
7374
{
7475
if ($this->app->runningInConsole()) {
7576
$this->publishes([
@@ -78,7 +79,7 @@ protected function registerPublishing(): void
7879
}
7980
}
8081

81-
protected function registerCommands(): void
82+
private function registerCommands(): void
8283
{
8384
if ($this->app->runningInConsole()) {
8485
$this->commands([
@@ -93,14 +94,14 @@ private function registerRoutes(): void
9394
{
9495
Route::post('/_boost/browser-logs', function (Request $request) {
9596
$logs = $request->input('logs', []);
96-
/** @var \Illuminate\Log\Logger $logger */
97+
/** @var Logger $logger */
9798
$logger = Log::channel('browser');
9899

99100
/**
100101
* @var array{
101102
* type: 'error'|'warn'|'info'|'log'|'table'|'window_error'|'uncaught_error'|'unhandled_rejection',
102103
* timestamp: string,
103-
* data: array<mixed>,
104+
* data: array,
104105
* url:string,
105106
* userAgent:string
106107
* } $log */
@@ -123,13 +124,10 @@ private function registerRoutes(): void
123124
}
124125

125126
/**
126-
* Build a string message for the log based on various input types. Single dimensional, and multi:
127-
* "data":[
128-
* {"message":"Unhandled Promise Rejection","reason":{"name":"TypeError","message":"NetworkError when attempting to fetch resource.","stack":""}}]
129-
*
130-
* @param array<mixed> $data
127+
* Build a string message for the log based on various input types. Single-dimensional, and multi:
128+
* "data": {"message":"Unhandled Promise Rejection","reason":{"name":"TypeError","message":"NetworkError when attempting to fetch resource.","stack":""}}]
131129
*/
132-
protected function buildLogMessageFromData(array $data): string
130+
private function buildLogMessageFromData(array $data): string
133131
{
134132
$messages = [];
135133

@@ -140,13 +138,14 @@ protected function buildLogMessageFromData(array $data): string
140138
is_bool($value) => $value ? 'true' : 'false',
141139
is_null($value) => 'null',
142140
is_object($value) => json_encode($value),
141+
default => $value,
143142
};
144143
}
145144

146145
return implode(' ', $messages);
147146
}
148147

149-
protected function registerBrowserLogger(): void
148+
private function registerBrowserLogger(): void
150149
{
151150
config([
152151
'logging.channels.browser' => [
@@ -158,7 +157,7 @@ protected function registerBrowserLogger(): void
158157
]);
159158
}
160159

161-
protected function registerBladeDirectives(BladeCompiler $bladeCompiler): void
160+
private function registerBladeDirectives(BladeCompiler $bladeCompiler): void
162161
{
163162
$bladeCompiler->directive('boostJs', fn () => '<?php echo \\Laravel\\Boost\\Services\\BrowserLogger::getScript(); ?>');
164163
}
@@ -167,11 +166,8 @@ private function mapJsTypeToPsr3Level(string $type): string
167166
{
168167
return match ($type) {
169168
'warn' => 'warning',
170-
'log' => 'debug',
171-
'table' => 'debug',
172-
'window_error' => 'error',
173-
'uncaught_error' => 'error',
174-
'unhandled_rejection' => 'error',
169+
'log', 'table' => 'debug',
170+
'window_error', 'uncaught_error', 'unhandled_rejection' => 'error',
175171
default => $type
176172
};
177173
}

src/Concerns/MakesHttpRequests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function client(): PendingRequest
1616
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:140.0) Gecko/20100101 Firefox/140.0 Laravel Boost',
1717
]);
1818

19-
// Disable SSL verification for local development URLs
20-
if (app()->environment('local') || str_contains(config('boost.hosted.api_url', ''), '.test')) {
19+
// Disable SSL verification for local development URLs and testing
20+
if (app()->environment(['local', 'testing']) || str_contains(config('boost.hosted.api_url', ''), '.test')) {
2121
$client = $client->withoutVerifying();
2222
}
2323

0 commit comments

Comments
 (0)