Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit701ff3f

Browse files
minor#31252 Fix left-associative ternary deprecation warnings for PHP 7.4 (thib92)
This PR was submitted for the master branch but it was merged into the 4.2 branch instead (closes#31252).Discussion----------Fix left-associative ternary deprecation warnings for PHP 7.4| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#31246| License | MIT| Doc PR | noneAll the context is explained in issue#31246. Only two files (three occurrences in total) used a chained ternary operator in the Symfony codebase, which will be deprecated in PHP 7.4 (removed in PHP 8), following [this RFC](https://wiki.php.net/rfc/ternary_associativity).Commits-------3022a36 Fix left-associative ternary deprecation warnings for PHP 7.4
2 parents571647f +3022a36 commit701ff3f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
110110
if (\is_array($method)) {
111111
if (isset($method['bus'])) {
112112
if (!\in_array($method['bus'],$busIds)) {
113-
$messageLocation =isset($tag['handles']) ?'declared in your tag attribute "handles"' :$r->implementsInterface(MessageSubscriberInterface::class) ?sprintf('returned by method "%s::getHandledMessages()"',$r->getName()) :sprintf('used as argument type in method "%s::%s()"',$r->getName(),$method);
113+
$messageLocation =isset($tag['handles']) ?'declared in your tag attribute "handles"' :($r->implementsInterface(MessageSubscriberInterface::class) ?sprintf('returned by method "%s::getHandledMessages()"',$r->getName()) :sprintf('used as argument type in method "%s::%s()"',$r->getName(),$method));
114114

115115
thrownewRuntimeException(sprintf('Invalid configuration %s for message "%s": bus "%s" does not exist.',$messageLocation,$message,$method['bus']));
116116
}
@@ -123,7 +123,7 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
123123
}
124124

125125
if ('*' !==$message && !class_exists($message) && !interface_exists($message,false)) {
126-
$messageLocation =isset($tag['handles']) ?'declared in your tag attribute "handles"' :$r->implementsInterface(MessageSubscriberInterface::class) ?sprintf('returned by method "%s::getHandledMessages()"',$r->getName()) :sprintf('used as argument type in method "%s::%s()"',$r->getName(),$method);
126+
$messageLocation =isset($tag['handles']) ?'declared in your tag attribute "handles"' :($r->implementsInterface(MessageSubscriberInterface::class) ?sprintf('returned by method "%s::getHandledMessages()"',$r->getName()) :sprintf('used as argument type in method "%s::%s()"',$r->getName(),$method));
127127

128128
thrownewRuntimeException(sprintf('Invalid handler service "%s": class or interface "%s" %s not found.',$serviceId,$message,$messageLocation));
129129
}

‎src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private function compileStaticRoutes(array $staticRoutes, array &$conditions): s
210210
foreach ($staticRoutesas$url =>$routes) {
211211
$code .=self::export($url)." => [\n";
212212
foreach ($routesas$name =>list($route,$hasTrailingSlash)) {
213-
$code .=$this->compileRoute($route,$name, !$route->compile()->getHostVariables() ?$route->getHost() :$route->compile()->getHostRegex() ?:null,$hasTrailingSlash,false,$conditions);
213+
$code .=$this->compileRoute($route,$name,(!$route->compile()->getHostVariables() ?$route->getHost() :$route->compile()->getHostRegex()) ?:null,$hasTrailingSlash,false,$conditions);
214214
}
215215
$code .="],\n";
216216
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp