Skip to content

Commit 93fa5c6

Browse files
Merge pull request #2 from phpviet/analysis-8nBMN5 [skip ci]
Apply fixes from StyleCI
2 parents ae5d559 + 59a304e commit 93fa5c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Transformer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(?DictionaryInterface $dictionary = null)
4747
*/
4848
public function toWords($number): string
4949
{
50-
if (!is_numeric($number)) {
50+
if (! is_numeric($number)) {
5151
throw new InvalidArgumentException(sprintf('Number arg (`%s`) must be numeric!', $number));
5252
}
5353

@@ -92,10 +92,10 @@ public function toCurrency($number, $unit = 'đồng'): string
9292
{
9393
$words = [];
9494
$originNumber = $number;
95-
$unit = (array)$unit;
95+
$unit = (array) $unit;
9696
[$number, $decimal] = $this->resolve($number);
9797

98-
if (0 === $decimal || !isset($unit[1])) {
98+
if (0 === $decimal || ! isset($unit[1])) {
9999
$words[] = $this->toWords($originNumber);
100100
$words[] = $unit[0];
101101
} else {
@@ -118,7 +118,7 @@ public function toCurrency($number, $unit = 'đồng'): string
118118
protected function resolve($number): array
119119
{
120120
$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;
122122

123123
if (false !== strpos($number, '.')) {
124124
$result = explode('.', $number, 2);

0 commit comments

Comments
 (0)