Skip to content

Commit 0f72179

Browse files
Merge pull request #1 from phpviet/analysis-8nBymA
Apply fixes from StyleCI
2 parents ae4777e + a10f83d commit 0f72179

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

src/Bootstrap.php

+4-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121
class Bootstrap implements BootstrapInterface
2222
{
23-
2423
/**
2524
* Đối tượng application đang cần boot.
2625
*
@@ -29,7 +28,7 @@ class Bootstrap implements BootstrapInterface
2928
protected $app;
3029

3130
/**
32-
* @inheritDoc
31+
* {@inheritdoc}
3332
*/
3433
public function bootstrap($app): void
3534
{
@@ -43,12 +42,11 @@ public function bootstrap($app): void
4342
*/
4443
protected function registerComponent(): void
4544
{
46-
if (!$this->app->get('n2w', false)) {
45+
if (! $this->app->get('n2w', false)) {
4746
$this->app->set('n2w', ['class' => N2W::class]);
4847
}
4948
}
5049

51-
5250
/**
5351
* Đăng ký các singleton classes vào container tối ưu việc khởi tạo đối tượng mới khi thay đổi từ điển.
5452
*/
@@ -58,9 +56,8 @@ protected function registerSingletonClasses(): void
5856
'singletons' => [
5957
Dictionary::class => Dictionary::class,
6058
DictionaryInterface::class => Dictionary::class,
61-
SouthDictionary::class => SouthDictionary::class
62-
]
59+
SouthDictionary::class => SouthDictionary::class,
60+
],
6361
]);
6462
}
65-
6663
}

src/N2W.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class N2W extends Component
4949
protected $dictionaries = [];
5050

5151
/**
52-
* @inheritDoc
52+
* {@inheritdoc}
5353
*/
5454
public function init(): void
5555
{
@@ -85,7 +85,7 @@ public function __call($name, $params)
8585
*/
8686
protected function getTransformer(): Transformer
8787
{
88-
if (!isset($this->dictionaries[$this->dictionary])) {
88+
if (! isset($this->dictionaries[$this->dictionary])) {
8989
throw new InvalidConfigException(sprintf('Dictionary (%s) is not defined!', $this->dictionary));
9090
}
9191

@@ -113,8 +113,7 @@ protected function defaultDictionaries(): array
113113
{
114114
return [
115115
self::SOUTH_DICTIONARY => SouthDictionary::class,
116-
self::STANDARD_DICTIONARY => Dictionary::class
116+
self::STANDARD_DICTIONARY => Dictionary::class,
117117
];
118118
}
119-
120119
}

tests/ChangeDictionaryTest.php

-1
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,4 @@ public function dataProvider(): array
129129
['sáu trăm năm mươi ngàn sáu trăm bảy mươi ba', 650673],
130130
];
131131
}
132-
133132
}

tests/ComponentTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class ComponentTest extends TestCase
1818
{
19-
2019
/**
2120
* @dataProvider dataProvider
2221
*/
@@ -25,13 +24,11 @@ public function testTransform($expect, $number)
2524
$this->assertEquals($expect, Yii::$app->n2w->toWords($number));
2625
}
2726

28-
2927
/**
3028
* @dataProvider currencyDataProvider
3129
*/
3230
public function testCurrencyTransform($expect, $number)
3331
{
3432
$this->assertEquals($expect, Yii::$app->n2w->toCurrency($number));
3533
}
36-
3734
}

tests/HelperTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class HelperTest extends TestCase
1818
{
19-
2019
/**
2120
* @dataProvider dataProvider
2221
*/
@@ -25,13 +24,11 @@ public function testTransform($expect, $number)
2524
$this->assertEquals($expect, N2WHelper::toWords($number));
2625
}
2726

28-
2927
/**
3028
* @dataProvider currencyDataProvider
3129
*/
3230
public function testCurrencyTransform($expect, $number)
3331
{
3432
$this->assertEquals($expect, N2WHelper::toCurrency($number));
3533
}
36-
3734
}

tests/bootstrap.php

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* @copyright (c) PHP Viet
66
* @license [MIT](https://opensource.org/licenses/MIT)
77
*/
8-
98
error_reporting(E_ALL);
109

1110
define('YII_ENABLE_ERROR_HANDLER', false);

0 commit comments

Comments
 (0)