Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings

Commit 6201643

Browse filesBrowse the repository at this point in the historyBrowse files
Check arrays and bools directly instead of comparing them to count()/true/false/[]
1 parent 8c85527 commit 6201643
Copy full SHA for 6201643

34 files changed

+38-38Lines changed: 38 additions & 38 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Handler/ServerLogHandler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function handle(LogRecord $record): bool
5858

5959
try {
6060
if (!$this->socket = $this->socket ?: $this->createSocket()) {
61-
return false === $this->bubble;
61+
return !$this->bubble;
6262
}
6363
} finally {
6464
restore_error_handler();
Collapse file

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationExtractCommand.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/TranslationExtractCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
199199
: new MergeOperation($currentCatalogue, $extractedCatalogue);
200200

201201
// Exit if no messages found.
202-
if (!\count($operation->getDomains())) {
202+
if (!$operation->getDomains()) {
203203
$errorIo->warning('No translation messages were found.');
204204

205205
return 0;
Collapse file

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ private function formatRouterConfig(array $config): string
617617
*/
618618
private function formatMethods(array $methods): string
619619
{
620-
if ([] === $methods) {
620+
if (!$methods) {
621621
$methods = ['ANY'];
622622
}
623623

Collapse file

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/ProfilerPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ProfilerPass implements CompilerPassInterface
2626
{
2727
public function process(ContainerBuilder $container): void
2828
{
29-
if (false === $container->hasDefinition('profiler')) {
29+
if (!$container->hasDefinition('profiler')) {
3030
return;
3131
}
3232

Collapse file

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2330,7 +2330,7 @@ private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enabl
23302330
->info('Mailer configuration')
23312331
->{$enableIfStandalone('symfony/mailer', Mailer::class)}()
23322332
->validate()
2333-
->ifTrue(static fn ($v) => isset($v['dsn']) && \count($v['transports']))
2333+
->ifTrue(static fn ($v) => isset($v['dsn']) && $v['transports'])
23342334
->thenInvalid('"dsn" and "transports" cannot be used together.')
23352335
->end()
23362336
->children()
Collapse file

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@ private function registerLockConfiguration(array $config, ContainerBuilder $cont
23532353
}
23542354

23552355
foreach ($config['resources'] as $resourceName => $resourceStores) {
2356-
if (0 === \count($resourceStores)) {
2356+
if (!$resourceStores) {
23572357
continue;
23582358
}
23592359

Collapse file

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigEnvironmentPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TwigEnvironmentPass implements CompilerPassInterface
2626

2727
public function process(ContainerBuilder $container): void
2828
{
29-
if (false === $container->hasDefinition('twig')) {
29+
if (!$container->hasDefinition('twig')) {
3030
return;
3131
}
3232

Collapse file

‎src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/TwigLoaderPass.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class TwigLoaderPass implements CompilerPassInterface
2525
{
2626
public function process(ContainerBuilder $container): void
2727
{
28-
if (false === $container->hasDefinition('twig')) {
28+
if (!$container->hasDefinition('twig')) {
2929
return;
3030
}
3131

Collapse file

‎src/Symfony/Component/AssetMapper/Command/ImportMapOutdatedCommand.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/AssetMapper/Command/ImportMapOutdatedCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7676
$packages = $input->getArgument('packages');
7777
$packagesUpdateInfos = $this->updateChecker->getAvailableUpdates($packages);
7878
$packagesUpdateInfos = array_filter($packagesUpdateInfos, static fn ($packageUpdateInfo) => $packageUpdateInfo->hasUpdate());
79-
if (0 === \count($packagesUpdateInfos)) {
79+
if (!$packagesUpdateInfos) {
8080
if ('json' === $input->getOption('format')) {
8181
$io->writeln('[]');
8282
} else {
Collapse file

‎src/Symfony/Component/Console/Application.php‎

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public function run(?InputInterface $input = null, ?OutputInterface $output = nu
258258
*/
259259
public function doRun(InputInterface $input, OutputInterface $output): int
260260
{
261-
if (true === $input->hasParameterOption(['--version', '-V'], true)) {
261+
if ($input->hasParameterOption(['--version', '-V'], true)) {
262262
$output->writeln($this->getLongVersion());
263263

264264
return 0;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.