File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function __construct(?DictionaryInterface $dictionary = null)
47
47
*/
48
48
public function toWords ($ number ): string
49
49
{
50
- if (!is_numeric ($ number )) {
50
+ if (! is_numeric ($ number )) {
51
51
throw new InvalidArgumentException (sprintf ('Number arg (`%s`) must be numeric! ' , $ number ));
52
52
}
53
53
@@ -92,10 +92,10 @@ public function toCurrency($number, $unit = 'đồng'): string
92
92
{
93
93
$ words = [];
94
94
$ originNumber = $ number ;
95
- $ unit = (array )$ unit ;
95
+ $ unit = (array ) $ unit ;
96
96
[$ number , $ decimal ] = $ this ->resolve ($ number );
97
97
98
- if (0 === $ decimal || !isset ($ unit [1 ])) {
98
+ if (0 === $ decimal || ! isset ($ unit [1 ])) {
99
99
$ words [] = $ this ->toWords ($ originNumber );
100
100
$ words [] = $ unit [0 ];
101
101
} else {
@@ -118,7 +118,7 @@ public function toCurrency($number, $unit = 'đồng'): string
118
118
protected function resolve ($ number ): array
119
119
{
120
120
$ number += 0 ; // trick xóa các số 0 lẻ sau cùng của phân số
121
- $ number = (string )$ number ;
121
+ $ number = (string ) $ number ;
122
122
123
123
if (false !== strpos ($ number , '. ' )) {
124
124
$ result = explode ('. ' , $ number , 2 );
You can’t perform that action at this time.
0 commit comments