Skip to content

Commit 1a612e1

Browse files
Merge branch '5.0' into 5.1
* 5.0: [VarDumper] fix typo Fix support for PHP8 union types [FrameworkBundle] preserve dots in query-string when redirecting [3.4] Fix support for PHP8 union types [PhpUnitBridge] Streamline ansi/no-ansi of composer according to phpunit --colors option [3.4] Small update in our internal terminology [Cache] fix compat with DBAL v3 [HttpClient] Convert CurlHttpClient::handlePush() to instance method [VarDumper] Fix CliDumper coloration [DI] tighten detection of local dirs to prevent false positives [FrameworkBundle] preserve dots in query-string when redirecting Fix precendence in 4.4 bumped Symfony version to 3.4.43 updated VERSION for 3.4.42 update CONTRIBUTORS for 3.4.42 updated CHANGELOG for 3.4.42
2 parents e737872 + 55c8dbe commit 1a612e1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ControllerMetadata/ArgumentMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function createArgumentMetadata($controller): array
4545
*/
4646
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function): ?string
4747
{
48-
if (!$type = $parameter->getType()) {
48+
if (!($type = $parameter->getType()) instanceof \ReflectionNamedType) {
4949
return null;
5050
}
5151
$name = $type->getName();

DependencyInjection/AddAnnotatedClassesToCachePass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ private function patternsToRegexps(array $patterns): array
127127

128128
private function matchAnyRegexps(string $class, array $regexps): bool
129129
{
130-
$blacklisted = false !== strpos($class, 'Test');
130+
$isTest = false !== strpos($class, 'Test');
131131

132132
foreach ($regexps as $regex) {
133-
if ($blacklisted && false === strpos($regex, 'Test')) {
133+
if ($isTest && false === strpos($regex, 'Test')) {
134134
continue;
135135
}
136136

EventListener/ErrorListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function onControllerArguments(ControllerArgumentsEvent $event)
102102
$r = new \ReflectionFunction(\Closure::fromCallable($event->getController()));
103103
$r = $r->getParameters()[$k] ?? null;
104104

105-
if ($r && (!$r->hasType() || \in_array($r->getType()->getName(), [FlattenException::class, LegacyFlattenException::class], true))) {
105+
if ($r && (!($r = $r->getType()) instanceof \ReflectionNamedType || \in_array($r->getName(), [FlattenException::class, LegacyFlattenException::class], true))) {
106106
$arguments = $event->getArguments();
107107
$arguments[$k] = FlattenException::createFromThrowable($e);
108108
$event->setArguments($arguments);

0 commit comments

Comments
 (0)