Skip to content

Commit 63f00fb

Browse files
2 parents 814de7f + 5e923d0 commit 63f00fb

File tree

10 files changed

+10
-27
lines changed

10 files changed

+10
-27
lines changed

src/Bundle.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
class Bundle extends BaseBundle
1919
{
2020
/**
21-
* @inheritDoc
21+
* {@inheritdoc}
2222
*/
2323
protected $name = 'PHPVietNumberToWordsBundle';
2424

2525
/**
26-
* @inheritDoc
26+
* {@inheritdoc}
2727
*/
2828
public function getContainerExtension(): Extension
2929
{
@@ -33,5 +33,4 @@ public function getContainerExtension(): Extension
3333

3434
return $this->extension;
3535
}
36-
3736
}

src/DependencyInjection/Configuration.php

-1
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ public function getConfigTreeBuilder(): TreeBuilder
4040

4141
return $treeBuilder;
4242
}
43-
4443
}

src/DependencyInjection/Extension.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function load(array $configs, ContainerBuilder $container): void
2727
$this->prepareConfig($configs);
2828
$configuration = new Configuration();
2929
$config = $this->processConfiguration($configuration, $configs);
30-
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
30+
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
3131
$loader->load('services.yaml');
3232
$definition = $container->getDefinition('n2w');
3333
$definition->addArgument($config);
@@ -50,12 +50,12 @@ protected function prepareConfig(&$configs): void
5050
{
5151
$defaultConfig = [
5252
'defaults' => [
53-
'dictionary' => 'standard'
53+
'dictionary' => 'standard',
5454
],
5555
'dictionaries' => [
5656
'standard' => 'n2w_standard_dictionary',
57-
'south' => 'n2w_south_dictionary'
58-
]
57+
'south' => 'n2w_south_dictionary',
58+
],
5959
];
6060

6161
foreach ($configs as &$config) {

src/Service.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected function getDictionaryInstance(?string $dictionary): ?DictionaryInterf
9797
{
9898
$dictionary = $dictionary ?? $this->getDefaultDictionary();
9999

100-
if (!$dictionaryService = $this->config['dictionaries'][$dictionary] ?? null) {
100+
if (! $dictionaryService = $this->config['dictionaries'][$dictionary] ?? null) {
101101
throw new InvalidConfigurationException(sprintf('Dictionary (%s) is not defined!', $dictionary));
102102
}
103103

@@ -113,5 +113,4 @@ protected function getDefaultDictionary(): string
113113
{
114114
return $this->config['defaults']['dictionary'];
115115
}
116-
117116
}

src/Twig/Extension/N2WExtension.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
class N2WExtension extends AbstractExtension
2020
{
21-
2221
/**
2322
* Phone number helper.
2423
*
@@ -27,7 +26,7 @@ class N2WExtension extends AbstractExtension
2726
protected $service;
2827

2928
/**
30-
* Khởi tạo extension
29+
* Khởi tạo extension.
3130
*
3231
* @param Service $service
3332
*/
@@ -46,5 +45,4 @@ public function getFilters(): array
4645
new TwigFilter('n2c', [$this->service, 'toCurrency']),
4746
];
4847
}
49-
5048
}

tests/BundleTest.php

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
class BundleTest extends TestCase
1919
{
20-
2120
public function testBundle(): void
2221
{
2322
$container = $this->getContainer();
@@ -28,5 +27,4 @@ public function testBundle(): void
2827
$service = $container->get('n2w');
2928
$this->assertInstanceOf(Service::class, $service);
3029
}
31-
3230
}

tests/ChangeDictionaryTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
*/
1515
class ChangeDictionaryTest extends TestCase
1616
{
17-
1817
public function testTransform(): void
1918
{
2019
$kernel = $this->createKernel();
21-
$kernel->addConfigFile(__DIR__ . '/Resources/change-dictionary-config.yaml');
20+
$kernel->addConfigFile(__DIR__.'/Resources/change-dictionary-config.yaml');
2221
$this->bootKernel();
2322
$service = $this->getContainer()->get('n2w');
2423
$this->assertEquals('một ngàn', $service->toWords(1000));
2524
}
26-
2725
}

tests/ServiceTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
*/
1515
class ServiceTest extends TestCase
1616
{
17-
1817
protected function setUp(): void
1918
{
20-
2119
}
2220

2321
/**
@@ -262,5 +260,4 @@ public function currencyDataProvider(): array
262260
['mười bảy triệu bảy trăm nghìn một trăm đồng', 17700100],
263261
];
264262
}
265-
266263
}

tests/TestCase.php

-3
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@
1818
*/
1919
class TestCase extends BaseBundleTestCase
2020
{
21-
2221
protected function setUp(): void
2322
{
2423
$this->addCompilerPass(new PublicServicePass());
2524
$this->bootKernel();
2625
}
2726

28-
2927
protected function getBundleClass(): string
3028
{
3129
return Bundle::class;
3230
}
33-
3431
}

tests/TwigTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
*/
1818
class TwigTest extends TestCase
1919
{
20-
2120
protected function setUp(): void
2221
{
2322
$this->addCompilerPass(new PublicServicePass());
2423
$kernel = $this->createKernel();
2524
$kernel->addBundle(TwigBundle::class);
2625
$kernel->setProjectDir(__DIR__);
27-
$kernel->addConfigFile(__DIR__ . '/Resources/twig-config.yaml');
26+
$kernel->addConfigFile(__DIR__.'/Resources/twig-config.yaml');
2827
$this->bootKernel();
2928
}
3029

@@ -48,5 +47,4 @@ public function testChangeDictionary(): void
4847
$twig = $container->get('twig');
4948
$this->assertEquals('một ngàn', trim($twig->render('change-dictionary.twig')));
5049
}
51-
5250
}

0 commit comments

Comments
 (0)