Skip to content

Commit 59bc570

Browse files
committed
Fix code style issues
1 parent 360b332 commit 59bc570

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

Command/CheckCommand.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Translation\Bundle\Command;
@@ -15,8 +16,6 @@
1516
use Translation\Bundle\Model\Configuration;
1617
use Translation\Bundle\Service\ConfigurationManager;
1718
use Translation\Bundle\Service\Importer;
18-
use function array_filter;
19-
use function count;
2019

2120
final class CheckCommand extends Command
2221
{
@@ -92,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9291
$io = new SymfonyStyle($input, $output);
9392

9493
if ($newMessages > 0) {
95-
$io->error(sprintf('%d new message(s) have been found, run bin/console translation:extract', $newMessages));
94+
$io->error(\sprintf('%d new message(s) have been found, run bin/console translation:extract', $newMessages));
9695

9796
return 1;
9897
}
@@ -101,7 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
101100

102101
if ($emptyTranslations > 0) {
103102
$io->error(
104-
sprintf('%d messages have empty translations, please provide translations for them', $emptyTranslations)
103+
\sprintf('%d messages have empty translations, please provide translations for them', $emptyTranslations)
105104
);
106105

107106
return 1;
@@ -133,14 +132,14 @@ private function countEmptyTranslations(MessageCatalogueInterface $catalogue): i
133132
$total = 0;
134133

135134
foreach ($catalogue->getDomains() as $domain) {
136-
$emptyTranslations = array_filter(
135+
$emptyTranslations = \array_filter(
137136
$catalogue->all($domain),
138137
function (string $message): bool {
139-
return $message === '';
138+
return '' === $message;
140139
}
141140
);
142141

143-
$total += count($emptyTranslations);
142+
$total += \count($emptyTranslations);
144143
}
145144

146145
return $total;

Tests/Functional/Command/CheckCommandTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Translation\Bundle\Tests\Functional\Command;
56

67
use Symfony\Bundle\FrameworkBundle\Console\Application;
78
use Symfony\Component\Console\Tester\CommandTester;
89
use Translation\Bundle\Tests\Functional\BaseTestCase;
9-
use function file_put_contents;
1010

1111
class CheckCommandTest extends BaseTestCase
1212
{
@@ -19,12 +19,12 @@ protected function setUp(): void
1919
{
2020
parent::setUp();
2121

22-
$this->kernel->addConfigFile(__DIR__ . '/../app/config/normal_config.yaml');
22+
$this->kernel->addConfigFile(__DIR__.'/../app/config/normal_config.yaml');
2323
$this->bootKernel();
2424
$this->application = new Application($this->kernel);
2525

26-
file_put_contents(
27-
__DIR__ . '/../app/Resources/translations/messages.sv.xlf',
26+
\file_put_contents(
27+
__DIR__.'/../app/Resources/translations/messages.sv.xlf',
2828
<<<'XML'
2929
<?xml version="1.0" encoding="utf-8"?>
3030
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="sv">
@@ -93,8 +93,8 @@ public function testReportsEmptyTranslationMessages(): void
9393

9494
public function testReportsNoNewTranslationMessages(): void
9595
{
96-
file_put_contents(
97-
__DIR__ . '/../app/Resources/translations/messages.sv.xlf',
96+
\file_put_contents(
97+
__DIR__.'/../app/Resources/translations/messages.sv.xlf',
9898
<<<'XML'
9999
<?xml version="1.0" encoding="utf-8"?>
100100
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="en" trgLang="sv">

0 commit comments

Comments
 (0)