Completed
Push — master ( db6fea...5e07c3 )
by Andreu
02:48 queued 01:21
created
src/MoneyFactoriesLocator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
23 23
 
24 24
     public function getMoneyFactory(string $isoCode): MoneyFactoryContract
25 25
     {
26
-        if (!isset($this->moneyFactories[$isoCode])) {
27
-            $this->moneyFactories[$isoCode] = new MoneyFactory(
26
+        if (!isset($this->moneyFactories[ $isoCode ])) {
27
+            $this->moneyFactories[ $isoCode ] = new MoneyFactory(
28 28
                 $this->currencyFactory->buildFromISOCode($isoCode)
29 29
             );
30 30
         }
31 31
 
32
-        return $this->moneyFactories[$isoCode];
32
+        return $this->moneyFactories[ $isoCode ];
33 33
     }
34 34
 
35 35
     /** @return string[] */
Please login to merge, or discard this patch.
src/CurrencyFactory.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
22 22
     private function __construct(array $data)
23 23
     {
24 24
         $this->data = $data;
25
-        $this->currencies = [];
25
+        $this->currencies = [ ];
26 26
     }
27 27
 
28 28
     public static function fromDataPath(string $dataPath = self::DEFAULT_DATA_PATH): CurrencyFactory
@@ -71,18 +71,18 @@  discard block
 block discarded – undo
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
                     CurrencyContract::BEFORE_PLACEMENT,
88 88
                     CurrencyContract::AFTER_PLACEMENT,
@@ -92,28 +92,28 @@  discard block
 block discarded – undo
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): CurrencyContract
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->currencies[$ISOCode])) {
105
-            $this->currencies[$ISOCode] = new Currency(
104
+        if (!isset($this->currencies[ $ISOCode ])) {
105
+            $this->currencies[ $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->currencies[$ISOCode];
116
+        return $this->currencies[ $ISOCode ];
117 117
     }
118 118
 
119 119
     /** @return string[] */
Please login to merge, or discard this patch.
src/Money.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Adsmurai\Currency;
6 6
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 1 === \preg_match(self::getAmountPlusIsoCodePattern($currency), $amount, $matches) ||
80 80
                 1 === \preg_match(self::getAmountPlusSymbolPattern($currency), $amount, $matches)
81 81
             ) {
82
-                return Decimal::fromString($matches['amount'], self::INNER_FRACTIONAL_DIGITS);
82
+                return Decimal::fromString($matches[ 'amount' ], self::INNER_FRACTIONAL_DIGITS);
83 83
             } else {
84 84
                 throw new InvalidArgumentException('Invalid currency value');
85 85
             }
Please login to merge, or discard this patch.