Skip to content

Commit d8e78d7

Browse files
Merge pull request #1 from phpviet/analysis-zdP4j7
Apply fixes from StyleCI
2 parents b46b710 + 7fb43a4 commit d8e78d7

File tree

9 files changed

+13
-29
lines changed

9 files changed

+13
-29
lines changed

config/n2w.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
*/
88

99
return [
10-
/**
10+
/*
1111
* Cấu hình từ điển mặc định theo chuẩn chung của cả nước
1212
*/
1313
'defaults' => [
1414
'dictionary' => 'standard',
1515
],
1616
'dictionaries' => [
17-
/**
17+
/*
1818
* Cấu hình các từ điển custom theo ý bạn.
1919
*/
2020
'standard' => PHPViet\NumberToWords\Dictionary::class,
21-
'south' => PHPViet\NumberToWords\SouthDictionary::class
22-
]
21+
'south' => PHPViet\NumberToWords\SouthDictionary::class,
22+
],
2323
];

src/N2WFacade.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class N2WFacade extends Facade
2929
public static $dictionary;
3030

3131
/**
32-
* @inheritDoc
32+
* {@inheritdoc}
3333
*/
3434
protected static function getFacadeAccessor(): Transformer
3535
{
@@ -57,12 +57,10 @@ protected static function getDefaultDictionary(): string
5757
*/
5858
protected static function makeDictionary(string $dictionary): DictionaryInterface
5959
{
60-
if (!$dictionaryClass = config("n2w.dictionaries.{$dictionary}")) {
60+
if (! $dictionaryClass = config("n2w.dictionaries.{$dictionary}")) {
6161
throw new InvalidArgumentException(sprintf('Dictionary (%s) is not defined!', $dictionary));
6262
}
6363

6464
return app()->make($dictionaryClass);
6565
}
66-
67-
6866
}

src/ServiceProvider.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,30 @@
2020
*/
2121
class ServiceProvider extends BaseServiceProvider implements DeferrableProvider
2222
{
23-
2423
public $bindings = [
25-
'n2w' => Transformer::class
24+
'n2w' => Transformer::class,
2625
];
2726

2827
public $singletons = [
2928
Dictionary::class => Dictionary::class,
3029
DictionaryInterface::class => Dictionary::class,
31-
SouthDictionary::class => SouthDictionary::class
30+
SouthDictionary::class => SouthDictionary::class,
3231
];
3332

3433
public function boot(): void
3534
{
3635
$this->publishes([
37-
__DIR__ . '/../config/n2w.php' => config_path('n2w.php'),
36+
__DIR__.'/../config/n2w.php' => config_path('n2w.php'),
3837
], 'config');
3938
}
4039

4140
public function register(): void
4241
{
43-
$this->mergeConfigFrom(__DIR__ . '/../config/n2w.php', 'n2w');
42+
$this->mergeConfigFrom(__DIR__.'/../config/n2w.php', 'n2w');
4443
}
4544

4645
public function provides(): array
4746
{
4847
return ['n2w'];
4948
}
50-
5149
}

src/Transformer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@
1717
*/
1818
class Transformer extends BaseTransformer
1919
{
20-
2120
use Macroable;
22-
2321
}

src/helpers.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use PHPViet\Laravel\NumberToWords\N2WFacade;
44

5-
if (!function_exists('n2w')) {
5+
if (! function_exists('n2w')) {
66

77
/**
88
* Hàm hổ trợ chuyển đổi số sang chữ số.
@@ -20,10 +20,9 @@ function n2w($number, string $dictionary = null): string
2020

2121
return $result;
2222
}
23-
2423
}
2524

26-
if (!function_exists('n2c')) {
25+
if (! function_exists('n2c')) {
2726

2827
/**
2928
* Hàm hổ trợ chuyển đổi số sang tiền tệ.
@@ -42,5 +41,4 @@ function n2c($number, $unit = 'đồng', string $dictionary = null): string
4241

4342
return $result;
4443
}
45-
4644
}

tests/ChangeDictionaryTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public function testTransform($expect, $number)
2222
$this->assertEquals($expect, n2w($number, 'south'));
2323
}
2424

25-
2625
public function dataProvider(): array
2726
{
2827
return [
@@ -128,5 +127,4 @@ public function dataProvider(): array
128127
['sáu trăm năm mươi ngàn sáu trăm bảy mươi ba', 650673],
129128
];
130129
}
131-
132130
}

tests/FacadeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class FacadeTest extends TestCase
1818
{
19-
2019
/**
2120
* @dataProvider dataProvider
2221
*/
@@ -32,5 +31,4 @@ public function testCurrencyTransform($expect, $number)
3231
{
3332
$this->assertEquals($expect, N2W::toCurrency($number));
3433
}
35-
3634
}

tests/HelpersTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
*/
1515
class HelpersTest extends TestCase
1616
{
17-
1817
/**
1918
* @dataProvider dataProvider
2019
*/
2120
public function testTransform($expect, $number)
2221
{
23-
$this->assertEquals($expect,n2w($number));
22+
$this->assertEquals($expect, n2w($number));
2423
}
2524

2625
/**
@@ -30,5 +29,4 @@ public function testCurrencyTransform($expect, $number)
3029
{
3130
$this->assertEquals($expect, n2c($number));
3231
}
33-
3432
}

tests/TestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*/
1919
class TestCase extends BaseTestCase
2020
{
21-
2221
protected function getPackageProviders($app)
2322
{
2423
return [ServiceProvider::class];
@@ -29,7 +28,6 @@ protected function getPackageAliases($app)
2928
return ['N2W' => N2WFacade::class];
3029
}
3130

32-
3331
public function dataProvider(): array
3432
{
3533
return [

0 commit comments

Comments
 (0)