@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Adsmurai\Currency; |
| 6 | 6 | |
@@ -23,13 +23,13 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function getCurrencyFactory(string $isoCode): MoneyFactoryInterface |
| 25 | 25 | { |
| 26 | - if (!isset($this->currencyFactories[$isoCode])) { |
|
| 27 | - $this->currencyFactories[$isoCode] = new MoneyFactory( |
|
| 26 | + if (!isset($this->currencyFactories[ $isoCode ])) { |
|
| 27 | + $this->currencyFactories[ $isoCode ] = new MoneyFactory( |
|
| 28 | 28 | $this->currencyTypeFactory->buildFromISOCode($isoCode) |
| 29 | 29 | ); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - return $this->currencyFactories[$isoCode]; |
|
| 32 | + return $this->currencyFactories[ $isoCode ]; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** @return string[] */ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Adsmurai\Currency; |
| 6 | 6 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | private function __construct(array $data) |
| 23 | 23 | { |
| 24 | 24 | $this->data = $data; |
| 25 | - $this->currencyTypes = []; |
|
| 25 | + $this->currencyTypes = [ ]; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function fromDataPath(string $dataPath = self::DEFAULT_DATA_PATH): CurrencyFactory |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | private static function hasValidSymbol(array $currencyData): bool |
| 72 | 72 | { |
| 73 | 73 | return |
| 74 | - isset($currencyData['symbol']) |
|
| 75 | - && \is_string($currencyData['symbol']) |
|
| 76 | - && !empty($currencyData['symbol']); |
|
| 74 | + isset($currencyData[ 'symbol' ]) |
|
| 75 | + && \is_string($currencyData[ 'symbol' ]) |
|
| 76 | + && !empty($currencyData[ 'symbol' ]); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | private static function hasValidSymbolPlacement(array $currencyData): bool |
| 80 | 80 | { |
| 81 | 81 | return |
| 82 | - isset($currencyData['symbolPlacement']) |
|
| 83 | - && \is_int($currencyData['symbolPlacement']) |
|
| 82 | + isset($currencyData[ 'symbolPlacement' ]) |
|
| 83 | + && \is_int($currencyData[ 'symbolPlacement' ]) |
|
| 84 | 84 | && \in_array( |
| 85 | - $currencyData['symbolPlacement'], |
|
| 85 | + $currencyData[ 'symbolPlacement' ], |
|
| 86 | 86 | [ |
| 87 | 87 | CurrencyInterface::BEFORE_PLACEMENT, |
| 88 | 88 | CurrencyInterface::AFTER_PLACEMENT, |
@@ -92,28 +92,28 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | private static function hasValidNumFractionalDigits(array $currencyData): bool |
| 94 | 94 | { |
| 95 | - return isset($currencyData['numFractionalDigits']) && \is_int($currencyData['numFractionalDigits']); |
|
| 95 | + return isset($currencyData[ 'numFractionalDigits' ]) && \is_int($currencyData[ 'numFractionalDigits' ]); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function buildFromISOCode(string $ISOCode): CurrencyInterface |
| 99 | 99 | { |
| 100 | - if (!isset($this->data[$ISOCode])) { |
|
| 100 | + if (!isset($this->data[ $ISOCode ])) { |
|
| 101 | 101 | throw new UnsupportedCurrencyISOCodeError($ISOCode); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (!isset($this->currencyTypes[$ISOCode])) { |
|
| 105 | - $this->currencyTypes[$ISOCode] = new Currency( |
|
| 104 | + if (!isset($this->currencyTypes[ $ISOCode ])) { |
|
| 105 | + $this->currencyTypes[ $ISOCode ] = new Currency( |
|
| 106 | 106 | $ISOCode, |
| 107 | - $this->data[$ISOCode]['symbol'], |
|
| 108 | - $this->data[$ISOCode]['numFractionalDigits'], |
|
| 109 | - $this->data[$ISOCode]['symbolPlacement'], |
|
| 110 | - (isset($this->data[$ISOCode]['name']) && !empty($this->data[$ISOCode]['name'])) |
|
| 111 | - ? $this->data[$ISOCode]['name'] |
|
| 107 | + $this->data[ $ISOCode ][ 'symbol' ], |
|
| 108 | + $this->data[ $ISOCode ][ 'numFractionalDigits' ], |
|
| 109 | + $this->data[ $ISOCode ][ 'symbolPlacement' ], |
|
| 110 | + (isset($this->data[ $ISOCode ][ 'name' ]) && !empty($this->data[ $ISOCode ][ 'name' ])) |
|
| 111 | + ? $this->data[ $ISOCode ][ 'name' ] |
|
| 112 | 112 | : '' |
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - return $this->currencyTypes[$ISOCode]; |
|
| 116 | + return $this->currencyTypes[ $ISOCode ]; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** @return string[] */ |