Completed
Branch master (37a6f7)
by Václav
05:19
created
src/Interfaces/Calculator/CalculatorAbstract.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                 if (is_object($value) || is_null($value)) {
29 29
                     $this->$name = $value;
30 30
                 } else {
31
-                    $this->$name = (string) $value;
31
+                    $this->$name = (string)$value;
32 32
                 }
33 33
                 return;
34 34
             }
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
                 }
51 51
             }
52 52
 
53
-            $processArray = function ($inputArray) use (&$processArray) {
53
+            $processArray = function($inputArray) use (&$processArray) {
54 54
                 $processedArray = array();
55 55
                 foreach ($inputArray as $key => $prop) {
56 56
                     if (is_string($prop)) {
57
-                        $propGetter = "get" . ucfirst($prop);
57
+                        $propGetter = "get".ucfirst($prop);
58 58
                         if (method_exists($this, $propGetter)) {
59 59
                             $processedArray[is_string($key) ? $key : $prop] = call_user_func(array($this, $propGetter));
60 60
                         } else {
Please login to merge, or discard this patch.
src/Utils/Config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
          * @return mixed
36 36
          * @throws Exception
37 37
          */
38
-        public static function getConfigField($key){
39
-            if(empty(static::$configArray)) {
38
+        public static function getConfigField($key) {
39
+            if (empty(static::$configArray)) {
40 40
                 Config::init();
41 41
             }
42 42
 
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
          * @param $key
54 54
          * @param $value
55 55
          */
56
-        public static function setConfigField($key, $value){
57
-            if(empty(static::$configArray)) {
56
+        public static function setConfigField($key, $value) {
57
+            if (empty(static::$configArray)) {
58 58
                 Config::init();
59 59
             }
60 60
 
Please login to merge, or discard this patch.
src/Utils/Strings.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                 $locale = Config::getConfigField("locale");
28 28
             }
29 29
 
30
-            $localePath = FinanCalc::getPath() . "/locale/$locale.php";
30
+            $localePath = FinanCalc::getPath()."/locale/$locale.php";
31 31
 
32 32
             if (!file_exists($localePath)) {
33 33
                 return null;
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
             $unformattedString = Strings::getString($identifier, $locale);
56 56
 
57 57
             return is_null($unformattedString) ?
58
-                null :
59
-                vsprintf($unformattedString, $formatArgs);
58
+                null : vsprintf($unformattedString, $formatArgs);
60 59
         }
61 60
     }
62 61
 }
63 62
\ No newline at end of file
Please login to merge, or discard this patch.
src/Utils/Time/TimeSpan.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -199,10 +199,10 @@
 block discarded – undo
199 199
         private function newDateIntervalAbsolute($years, $months, $days) {
200 200
             $this->setdateInterval(
201 201
                 new DateInterval(
202
-                    "P" .
203
-                    (string)$years . "Y" .
204
-                    (string)$months . "M" .
205
-                    (string)$days . "D"
202
+                    "P".
203
+                    (string)$years."Y".
204
+                    (string)$months."M".
205
+                    (string)$days."D"
206 206
                 )
207 207
             );
208 208
         }
Please login to merge, or discard this patch.
src/Utils/Helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
          * @return bool|null
110 110
          */
111 111
         static function checkNumberRelativityToZero($checkedVariable, $expectedResult) {
112
-            if(is_numeric((string)$checkedVariable)) {
112
+            if (is_numeric((string)$checkedVariable)) {
113 113
                 return MathFuncs::comp($checkedVariable, "0.00") == $expectedResult;
114 114
             }
115 115
 
Please login to merge, or discard this patch.
src/FinanCalc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
          */
115 115
 
116 116
         private function populateFactoryClassesArray() {
117
-            $factoryFiles = glob(FinanCalc::getPath() . Config::getConfigField('factories_relative_path') . '/*.php');
117
+            $factoryFiles = glob(FinanCalc::getPath().Config::getConfigField('factories_relative_path').'/*.php');
118 118
             $factoriesNamespace = Config::getConfigField('factories_namespace');
119 119
 
120 120
             foreach ($factoryFiles as $factoryFile) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                         try {
128 128
                             /** @noinspection PhpIncludeInspection */
129 129
                             require_once($factoryFile);
130
-                            $factoryClassReflector = new ReflectionClass($factoriesNamespace . '\\' . $factoryClassName);
130
+                            $factoryClassReflector = new ReflectionClass($factoriesNamespace.'\\'.$factoryClassName);
131 131
                         } catch (ReflectionException $e) {
132 132
                             error_log(ErrorMessages::getFactoryClassExpectedInNamespaceMessage($factoryClassName, $factoriesNamespace));
133 133
                             continue;
Please login to merge, or discard this patch.
src/Calculators/StockDividendDiscountModelCalculator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
         /**
71 71
          * @param $stockVIR
72 72
          */
73
-        public function setStockVIR($stockVIR){
73
+        public function setStockVIR($stockVIR) {
74 74
             $this->setProperty("stockVIR", $stockVIR, Lambdas::checkIfPositive());
75 75
         }
76 76
 
Please login to merge, or discard this patch.
src/Calculators/DebtAmortizator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
             // storing the debt repayments (i.e., representing the amortization schedule)
132 132
             // NOTE: rounding to two decimal places takes place when calculating the interest and principal parts
133 133
             // of a single repayment
134
-            for($i = 1; $i <= $this->debtNoOfCompoundingPeriods; $i++) {
134
+            for ($i = 1; $i <= $this->debtNoOfCompoundingPeriods; $i++) {
135 135
                 $interestAmount = MathFuncs::mul($this->debtInterest, $unpaidBalance);
136 136
                 $principalAmount = MathFuncs::sub($this->getDebtSingleRepayment(), $interestAmount);
137 137
 
Please login to merge, or discard this patch.
src/Calculators/BondDurationCalculator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
         public function getBondNominalCashFlows() {
91 91
             // nominal cash flows = coupons each period + face value in the last period
92 92
             $numberOfPayments = $this->getBondNoOfPayments();
93
-            $couponPayment =  $this->getCouponPayment();
93
+            $couponPayment = $this->getCouponPayment();
94 94
 
95 95
             $nominalCashFlows = array();
96 96
             for ($i = 1; $i <= $numberOfPayments; $i++) {
Please login to merge, or discard this patch.