Passed
Pull Request — master (#165)
by Tomáš
02:19
created
src/Phpml/Classification/Linear/LogisticRegression.php 1 patch
Spacing   +3 added lines, -3 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 Phpml\Classification\Linear;
6 6
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                  * The gradient of the cost function to be used with gradient descent:
194 194
                  *		∇J(x) = -(y - h(x)) = (h(x) - y)
195 195
                  */
196
-                $callback = function ($weights, $sample, $y) use ($penalty) {
196
+                $callback = function($weights, $sample, $y) use ($penalty) {
197 197
                     $this->weights = $weights;
198 198
                     $hX = $this->output($sample);
199 199
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                  * The gradient of the cost function:
225 225
                  *		∇J(x) = -(h(x) - y) . h(x) . (1 - h(x))
226 226
                  */
227
-                $callback = function ($weights, $sample, $y) use ($penalty) {
227
+                $callback = function($weights, $sample, $y) use ($penalty) {
228 228
                     $this->weights = $weights;
229 229
                     $hX = $this->output($sample);
230 230
 
Please login to merge, or discard this patch.
src/Phpml/DimensionReduction/LDA.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 Phpml\DimensionReduction;
6 6
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
         // Calculate overall mean of the dataset for each column
148 148
         $numElements = array_sum($counts);
149
-        $map = function ($el) use ($numElements) {
149
+        $map = function($el) use ($numElements) {
150 150
             return $el / $numElements;
151 151
         };
152 152
         $this->overallMean = array_map($map, $overallMean);
Please login to merge, or discard this patch.
src/Phpml/DimensionReduction/EigenTransformerBase.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\DimensionReduction;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/Math/Statistic/Gaussian.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\Math\Statistic;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/NeuralNetwork/ActivationFunction/ThresholdedReLU.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\NeuralNetwork\ActivationFunction;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/Math/Comparison.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\Math;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/FeatureExtraction/TokenCountVectorizer.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 Phpml\FeatureExtraction;
6 6
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         }
74 74
     }
75 75
 
76
-    private function transformSample(string &$sample): void
76
+    private function transformSample(string & $sample): void
77 77
     {
78 78
         $counts = [];
79 79
         $tokens = $this->tokenizer->tokenize($sample);
Please login to merge, or discard this patch.
src/Phpml/NeuralNetwork/Network/MultilayerPerceptron.php 2 patches
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 Phpml\NeuralNetwork\Network;
6 6
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $this->addLayer(new Layer($nodes, Input::class));
133 133
     }
134 134
 
135
-    private function addNeuronLayers(array $layers, ?ActivationFunction $activationFunction = null): void
135
+    private function addNeuronLayers(array $layers, ?ActivationFunction $activationFunction = null) : void
136 136
     {
137 137
         foreach ($layers as $neurons) {
138 138
             $this->addLayer(new Layer($neurons, Neuron::class, $activationFunction));
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -132,6 +132,9 @@
 block discarded – undo
132 132
         $this->addLayer(new Layer($nodes, Input::class));
133 133
     }
134 134
 
135
+    /**
136
+     * @param ActivationFunction $activationFunction
137
+     */
135 138
     private function addNeuronLayers(array $layers, ?ActivationFunction $activationFunction = null): void
136 139
     {
137 140
         foreach ($layers as $neurons) {
Please login to merge, or discard this patch.
src/Phpml/SupportVectorMachine/SupportVectorMachine.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 Phpml\SupportVectorMachine;
6 6
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         );
235 235
     }
236 236
 
237
-    private function ensureDirectorySeparator(string &$path): void
237
+    private function ensureDirectorySeparator(string & $path): void
238 238
     {
239 239
         if (substr($path, -1) !== DIRECTORY_SEPARATOR) {
240 240
             $path .= DIRECTORY_SEPARATOR;
Please login to merge, or discard this patch.