Skip to content

Commit 0ffff14

Browse files
Merge branch 'main' into feat/render-reports-hook
2 parents 2d0e73b + 2649f9a commit 0ffff14

20 files changed

Lines changed: 245 additions & 59 deletions

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: [8.5, 8.4, 8.3, 8.2]
11+
php: [8.5, 8.4, 8.3, 8.2, 8.1]
1212
dependency-version: [prefer-lowest, prefer-stable]
1313
os: [ubuntu-latest]
1414

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
All notable changes to `flare-client-php` will be documented in this file
44

5+
## 3.2.0 - 2026-07-03
6+
7+
### What's Changed
8+
9+
* Support PHP 8.1 by @rubenvanassche in https://github.com/spatie/flare-client-php/pull/82
10+
11+
**Full Changelog**: https://github.com/spatie/flare-client-php/compare/3.1.2...3.2.0
12+
13+
## 3.1.2 - 2026-07-02
14+
15+
### What's Changed
16+
17+
* Strip embedded credentials from git remote URL by @rubenvanassche in https://github.com/spatie/flare-client-php/pull/81
18+
19+
**Full Changelog**: https://github.com/spatie/flare-client-php/compare/3.1.1...3.1.2
20+
21+
## 3.1.1 - 2026-07-01
22+
23+
### What's Changed
24+
25+
* Fix previous throwable stacktrace using the wrong exception's frames by @rubenvanassche in https://github.com/spatie/flare-client-php/pull/79
26+
* Fix CI failures caused by Symfony 8 by @rubenvanassche in https://github.com/spatie/flare-client-php/pull/80
27+
28+
**Full Changelog**: https://github.com/spatie/flare-client-php/compare/3.1.0...3.1.1
29+
530
## 3.1.0 - 2026-05-28
631

732
### What's Changed

composer.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"homepage": "https://github.com/spatie/flare-client-php",
1111
"license": "MIT",
1212
"require": {
13-
"php": "^8.2",
13+
"php": "^8.1",
1414
"ext-curl": "*",
1515
"guzzlehttp/guzzle": "^7.9",
1616
"monolog/monolog": "^3.0",
1717
"psr/container": "^2.0",
1818
"spatie/backtrace": "^1.8.0",
1919
"symfony/console": "^5.2|^6.0|^7.0|^8.0",
20-
"spatie/flare-daemon": "^0.1|^0.2",
20+
"spatie/flare-daemon": "^0.3",
2121
"symfony/http-foundation": "^5.2|^6.0|^7.0|^8.0",
2222
"symfony/mime": "^5.2|^6.0|^7.0|^8.0",
2323
"symfony/process": "^5.2|^6.0|^7.0|^8.0",
@@ -27,8 +27,9 @@
2727
"friendsofphp/php-cs-fixer": "^3.89",
2828
"pestphp/pest": "^2.36.0|^3.0|^4.0",
2929
"phpstan/extension-installer": "^1.4",
30-
"phpstan/phpstan-deprecation-rules": "^1.2",
31-
"phpstan/phpstan-phpunit": "^1.4",
30+
"phpstan/phpstan": "^2.0",
31+
"phpstan/phpstan-deprecation-rules": "^2.0",
32+
"phpstan/phpstan-phpunit": "^2.0",
3233
"spatie/invade": "^2.1",
3334
"spatie/pest-plugin-snapshots": "^2.2"
3435
},
@@ -55,6 +56,11 @@
5556
"allow-plugins": {
5657
"pestphp/pest-plugin": true,
5758
"phpstan/extension-installer": true
59+
},
60+
"policy": {
61+
"advisories": {
62+
"ignore-id": ["PKSA-z3gr-8qht-p93v"]
63+
}
5864
}
5965
},
6066
"prefer-stable": true,

phpstan-baseline.neon

Lines changed: 115 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,211 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:cache\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\CacheRecorder\\\\CacheRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
4+
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
5+
identifier: function.alreadyNarrowedType
6+
count: 1
7+
path: src/AttributesProviders/PhpRequestAttributesProvider.php
8+
9+
-
10+
message: '#^Call to function method_exists\(\) with Symfony\\Component\\HttpFoundation\\Session\\SessionInterface and ''all'' will always evaluate to true\.$#'
11+
identifier: function.alreadyNarrowedType
12+
count: 1
13+
path: src/AttributesProviders/SymfonyRequestAttributesProvider.php
14+
15+
-
16+
message: '#^Call to function array_key_exists\(\) with ''body'' and array\{time_unix_nano\: int, observed_time_unix_nano\: int, trace_id\?\: string, span_id\?\: string, flags\?\: string, severity_text\?\: string, severity_number\?\: int, body\: mixed, \.\.\.\} will always evaluate to true\.$#'
17+
identifier: function.alreadyNarrowedType
18+
count: 1
19+
path: src/Exporters/OpenTelemetryJsonExporter.php
20+
21+
-
22+
message: '#^Method Spatie\\FlareClient\\Flare\:\:cache\(\) should return Spatie\\FlareClient\\Recorders\\CacheRecorder\\CacheRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
23+
identifier: return.type
524
count: 1
625
path: src/Flare.php
726

827
-
9-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:command\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\CommandRecorder\\\\CommandRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
28+
message: '#^Method Spatie\\FlareClient\\Flare\:\:command\(\) should return Spatie\\FlareClient\\Recorders\\CommandRecorder\\CommandRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
29+
identifier: return.type
1030
count: 1
1131
path: src/Flare.php
1232

1333
-
14-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:externalHttp\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\ExternalHttpRecorder\\\\ExternalHttpRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
34+
message: '#^Method Spatie\\FlareClient\\Flare\:\:externalHttp\(\) should return Spatie\\FlareClient\\Recorders\\ExternalHttpRecorder\\ExternalHttpRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
35+
identifier: return.type
1536
count: 1
1637
path: src/Flare.php
1738

1839
-
19-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:filesystem\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\FilesystemRecorder\\\\FilesystemRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
40+
message: '#^Method Spatie\\FlareClient\\Flare\:\:filesystem\(\) should return Spatie\\FlareClient\\Recorders\\FilesystemRecorder\\FilesystemRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
41+
identifier: return.type
2042
count: 1
2143
path: src/Flare.php
2244

2345
-
24-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:glow\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\GlowRecorder\\\\GlowRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
46+
message: '#^Method Spatie\\FlareClient\\Flare\:\:glow\(\) should return Spatie\\FlareClient\\Recorders\\GlowRecorder\\GlowRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
47+
identifier: return.type
2548
count: 1
2649
path: src/Flare.php
2750

2851
-
29-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:job\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\JobRecorder\\\\JobRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
52+
message: '#^Method Spatie\\FlareClient\\Flare\:\:job\(\) should return Spatie\\FlareClient\\Recorders\\JobRecorder\\JobRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
53+
identifier: return.type
3054
count: 1
3155
path: src/Flare.php
3256

3357
-
34-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:query\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\QueryRecorder\\\\QueryRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
58+
message: '#^Method Spatie\\FlareClient\\Flare\:\:query\(\) should return Spatie\\FlareClient\\Recorders\\QueryRecorder\\QueryRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
59+
identifier: return.type
3560
count: 1
3661
path: src/Flare.php
3762

3863
-
39-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:queue\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\QueueRecorder\\\\QueueRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
64+
message: '#^Method Spatie\\FlareClient\\Flare\:\:queue\(\) should return Spatie\\FlareClient\\Recorders\\QueueRecorder\\QueueRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
65+
identifier: return.type
4066
count: 1
4167
path: src/Flare.php
4268

4369
-
44-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:redisCommand\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\RedisCommandRecorder\\\\RedisCommandRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
70+
message: '#^Method Spatie\\FlareClient\\Flare\:\:redisCommand\(\) should return Spatie\\FlareClient\\Recorders\\RedisCommandRecorder\\RedisCommandRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
71+
identifier: return.type
4572
count: 1
4673
path: src/Flare.php
4774

4875
-
49-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:request\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\RequestRecorder\\\\RequestRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
76+
message: '#^Method Spatie\\FlareClient\\Flare\:\:request\(\) should return Spatie\\FlareClient\\Recorders\\RequestRecorder\\RequestRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
77+
identifier: return.type
5078
count: 1
5179
path: src/Flare.php
5280

5381
-
54-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:response\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\ResponseRecorder\\\\ResponseRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
82+
message: '#^Method Spatie\\FlareClient\\Flare\:\:response\(\) should return Spatie\\FlareClient\\Recorders\\ResponseRecorder\\ResponseRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
83+
identifier: return.type
5584
count: 1
5685
path: src/Flare.php
5786

5887
-
59-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:routing\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\RoutingRecorder\\\\RoutingRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
88+
message: '#^Method Spatie\\FlareClient\\Flare\:\:routing\(\) should return Spatie\\FlareClient\\Recorders\\RoutingRecorder\\RoutingRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
89+
identifier: return.type
6090
count: 1
6191
path: src/Flare.php
6292

6393
-
64-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:transaction\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\TransactionRecorder\\\\TransactionRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
94+
message: '#^Method Spatie\\FlareClient\\Flare\:\:transaction\(\) should return Spatie\\FlareClient\\Recorders\\TransactionRecorder\\TransactionRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
95+
identifier: return.type
6596
count: 1
6697
path: src/Flare.php
6798

6899
-
69-
message: "#^Method Spatie\\\\FlareClient\\\\Flare\\:\\:view\\(\\) should return Spatie\\\\FlareClient\\\\Recorders\\\\ViewRecorder\\\\ViewRecorder\\|null but returns Spatie\\\\FlareClient\\\\Contracts\\\\Recorders\\\\Recorder\\|null\\.$#"
100+
message: '#^Method Spatie\\FlareClient\\Flare\:\:view\(\) should return Spatie\\FlareClient\\Recorders\\ViewRecorder\\ViewRecorder\|null but returns Spatie\\FlareClient\\Contracts\\Recorders\\Recorder\|null\.$#'
101+
identifier: return.type
70102
count: 1
71103
path: src/Flare.php
72104

73105
-
74-
message: "#^Access to an undefined property Spatie\\\\FlareClient\\\\Contracts\\\\FlareCollectType\\:\\:\\$value\\.$#"
106+
message: '#^Access to an undefined property Spatie\\FlareClient\\Contracts\\FlareCollectType\:\:\$value\.$#'
107+
identifier: property.notFound
75108
count: 4
76109
path: src/FlareConfig.php
77110

78111
-
79-
message: "#^Unsafe usage of new static\\(\\)\\.$#"
112+
message: '#^Property Spatie\\FlareClient\\FlareConfig\:\:\$collects \(array\<string, array\{type\: Spatie\\FlareClient\\Contracts\\FlareCollectType, ignored\: bool\|null, options\: array\}\>\) does not accept non\-empty\-array\<array\{type\: Spatie\\FlareClient\\Contracts\\FlareCollectType, ignored\: bool\|null, options\?\: array\}\>\.$#'
113+
identifier: assign.propertyType
80114
count: 1
81115
path: src/FlareConfig.php
82116

83117
-
84-
message: "#^Property Spatie\\\\FlareClient\\\\Logger\\:\\:\\$logs \\(array\\<int, array\\{timeUnixNano\\: int, observedTimeUnixNano\\: int, traceId\\?\\: string, spanId\\?\\: string, flags\\?\\: string, severityText\\?\\: string, severityNumber\\?\\: int, body\\: mixed, \\.\\.\\.\\}\\>\\) does not accept non\\-empty\\-array\\<int, array\\{body\\: mixed, timeUnixNano\\?\\: int\\|int\\<1, max\\>, observedTimeUnixNano\\?\\: int\\|int\\<1, max\\>, traceId\\?\\: string, spanId\\?\\: string, flags\\?\\: string, severityText\\?\\: string, severityNumber\\?\\: int\\|int\\<1, max\\>, \\.\\.\\.\\}\\>\\.$#"
118+
message: '#^Property Spatie\\FlareClient\\FlareConfig\:\:\$collects \(array\<string, array\{type\: Spatie\\FlareClient\\Contracts\\FlareCollectType, ignored\: bool\|null, options\: array\}\>\) does not accept non\-empty\-array\<array\{type\: Spatie\\FlareClient\\Contracts\\FlareCollectType, ignored\?\: bool\|null, options\: array\}\>\.$#'
119+
identifier: assign.propertyType
85120
count: 1
86-
path: src/Logger.php
121+
path: src/FlareConfig.php
87122

88123
-
89-
message: "#^Class Spatie\\\\FlareClient\\\\Recorders\\\\ExternalHttpRecorder\\\\Guzzle\\\\FlareHandlerStack extends @final class GuzzleHttp\\\\HandlerStack\\.$#"
124+
message: '#^Unsafe usage of new static\(\)\.$#'
125+
identifier: new.static
90126
count: 1
91-
path: src/Recorders/ExternalHttpRecorder/Guzzle/FlareHandlerStack.php
127+
path: src/FlareConfig.php
92128

93129
-
94-
message: "#^Instanceof between Spatie\\\\FlareClient\\\\Spans\\\\SpanEvent and Spatie\\\\FlareClient\\\\Spans\\\\Span will always evaluate to false\\.$#"
130+
message: '#^Property Spatie\\FlareClient\\FlareProvider\:\:\$container on left side of \?\?\= is not nullable nor uninitialized\.$#'
131+
identifier: nullCoalesce.initializedProperty
95132
count: 1
96-
path: src/Recorders/SpanEventsRecorder.php
133+
path: src/FlareProvider.php
97134

98135
-
99-
message: "#^Instanceof between \\*NEVER\\* and Spatie\\\\FlareClient\\\\Spans\\\\SpanEvent will always evaluate to false\\.$#"
136+
message: '#^Property Spatie\\FlareClient\\Logger\:\:\$logs \(array\<int, array\{timeUnixNano\: int, observedTimeUnixNano\: int, traceId\?\: string, spanId\?\: string, flags\?\: string, severityText\?\: string, severityNumber\?\: int, body\: mixed, \.\.\.\}\>\) does not accept non\-empty\-array\<int, array\{body\: mixed, timeUnixNano\?\: int, observedTimeUnixNano\?\: int, traceId\?\: string, spanId\?\: string, flags\?\: string, severityText\?\: string, severityNumber\?\: int, \.\.\.\}\>\.$#'
137+
identifier: assign.propertyType
100138
count: 1
101-
path: src/Recorders/SpansRecorder.php
139+
path: src/Logger.php
102140

103141
-
104-
message: "#^Match arm is unreachable because previous comparison is always true\\.$#"
142+
message: '#^Class Spatie\\FlareClient\\Recorders\\ExternalHttpRecorder\\Guzzle\\FlareHandlerStack extends @final class GuzzleHttp\\HandlerStack\.$#'
143+
identifier: class.extendsFinalByPhpDoc
105144
count: 1
106-
path: src/Recorders/SpansRecorder.php
145+
path: src/Recorders/ExternalHttpRecorder/Guzzle/FlareHandlerStack.php
107146

108147
-
109-
message: "#^Parameter \\#1 \\$callback of function set_error_handler expects \\(callable\\(int, string, string, int\\)\\: bool\\)\\|null, array\\{\\$this\\(Spatie\\\\FlareClient\\\\Reporter\\), 'handleError'\\} given\\.$#"
148+
message: '#^Cannot unset property Spatie\\FlareClient\\ReportFactory\:\:\$throwable because it might have hooks in a subclass\.$#'
149+
identifier: unset.possiblyHookedProperty
150+
count: 1
151+
path: src/ReportFactory.php
152+
153+
-
154+
message: '#^Property Spatie\\FlareClient\\ReportFactory\:\:\$resource in isset\(\) is not nullable nor uninitialized\.$#'
155+
identifier: isset.initializedProperty
156+
count: 1
157+
path: src/ReportFactory.php
158+
159+
-
160+
message: '#^Parameter \#1 \$callback of function set_error_handler expects \(callable\(int, string, string, int\)\: bool\)\|null, array\{\$this\(Spatie\\FlareClient\\Reporter\), ''handleError''\} given\.$#'
161+
identifier: argument.type
110162
count: 2
111163
path: src/Reporter.php
112164

113165
-
114-
message: "#^Method Spatie\\\\FlareClient\\\\Support\\\\Container\\:\\:resolveAutowiringDefinition\\(\\) should return array\\<string, array\\{id\\: class\\-string, default\\?\\: mixed\\}\\>\\|null but returns array\\<non\\-empty\\-string, array\\{id\\: string, default\\: mixed\\}\\>\\.$#"
166+
message: '#^Parameter \#3 \$value of function curl_setopt expects array\|string, string\|false given\.$#'
167+
identifier: argument.type
168+
count: 1
169+
path: src/Senders/CurlSender.php
170+
171+
-
172+
message: '#^Parameter \#3 \$value of function curl_setopt expects non\-empty\-string, string given\.$#'
173+
identifier: argument.type
174+
count: 1
175+
path: src/Senders/CurlSender.php
176+
177+
-
178+
message: '#^Parameter \#3 \$value of function curl_setopt expects non\-empty\-string, string given\.$#'
179+
identifier: argument.type
180+
count: 1
181+
path: src/Senders/DaemonSender.php
182+
183+
-
184+
message: '#^Method Spatie\\FlareClient\\Support\\Container\:\:resolveAutowiringDefinition\(\) should return array\<string, array\{id\: class\-string, default\?\: mixed\}\>\|null but returns array\<non\-empty\-string, array\{id\: string, default\: mixed\}\>\.$#'
185+
identifier: return.type
115186
count: 1
116187
path: src/Support/Container.php
117188

118189
-
119-
message: "#^Access to an undefined property Spatie\\\\FlareClient\\\\Contracts\\\\FlareSpanType\\:\\:\\$value\\.$#"
190+
message: '#^Parameter \#1 \$array \(list\<array\|null\>\) of array_values is already a list, call has no effect\.$#'
191+
identifier: arrayValues.list
192+
count: 1
193+
path: src/Support/OpenTelemetryAttributeMapper.php
194+
195+
-
196+
message: '#^Access to an undefined property Spatie\\FlareClient\\Contracts\\FlareSpanType\:\:\$value\.$#'
197+
identifier: property.notFound
120198
count: 2
121199
path: src/Tracer.php
122200

123201
-
124-
message: "#^Comparison operation \"\\>\" between int\\<1, max\\> and 0 is always true\\.$#"
202+
message: '#^Comparison operation "\>" between int\<1, max\> and 0 is always true\.$#'
203+
identifier: greater.alwaysTrue
204+
count: 1
205+
path: src/Tracer.php
206+
207+
-
208+
message: '#^Trying to invoke \(Closure\(Spatie\\FlareClient\\Spans\\SpanEvent\)\: \(Spatie\\FlareClient\\Spans\\SpanEvent\|void\|null\)\)\|null but it might not be a callable\.$#'
209+
identifier: callable.nonCallable
125210
count: 1
126211
path: src/Tracer.php

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ parameters:
1515
path: src/FlareProvider.php
1616

1717
tmpDir: build/phpstan
18-
checkMissingIterableValueType: true

src/AttributesProviders/GitAttributesProvider.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function collectGitFileInfo(string $baseDirectory): array
5858

5959
if ($config = file_get_contents($gitDirectory.'/config')) {
6060
if (preg_match('/\[remote "origin"\][^[]*url\s*=\s*(.+?)$/m', $config, $matches)) {
61-
$data['git.remote'] = trim($matches[1]);
61+
$data['git.remote'] = $this->sanitizeRemoteUrl(trim($matches[1]));
6262
}
6363
}
6464

@@ -156,12 +156,21 @@ protected function collectGitProcessInfo(string $baseDir): array
156156
'git.hash' => $parts[0] ?: null,
157157
'git.message' => $parts[1] ?: null,
158158
'git.tag' => $parts[2] ?: null,
159-
'git.remote' => $parts[3] ?: null,
159+
'git.remote' => $parts[3] ? $this->sanitizeRemoteUrl($parts[3]) : null,
160160
'git.branch' => $parts[4] ?: null,
161161
'git.is_dirty' => $parts[5] === 'dirty',
162162
];
163163

164-
return array_filter($data, fn ($value) => is_bool($value) || ($value !== null && $value !== ''));
164+
return array_filter($data, fn ($value) => is_bool($value) || $value !== null);
165+
}
166+
167+
protected function sanitizeRemoteUrl(string $url): string
168+
{
169+
if (! preg_match('#^(https?://)[^/]*@(.+)$#i', $url, $matches)) {
170+
return $url;
171+
}
172+
173+
return $matches[1].$matches[2];
165174
}
166175

167176
protected function getGitBaseDirectory(): ?string

src/AttributesProviders/SymfonyInputCommandAttributesProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function getArguments(): array
4646
continue;
4747
}
4848

49-
if (is_bool($option) && $option === true) {
49+
if ($option === true) {
5050
$options[] = "--{$key}";
5151

5252
continue;

0 commit comments

Comments
 (0)