Completed
Pull Request — master (#44)
by Alberto
07:10
created
src/Moka.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka;
5 5
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $backtrace = debug_backtrace();
131 131
         foreach ($backtrace as $frame) {
132
-            if (!isset($frame['object'])) {
132
+            if ( ! isset($frame['object'])) {
133 133
                 continue;
134 134
             }
135 135
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     private static function ensurePluginLoad(string $pluginName): void
178 178
     {
179
-        if (!array_key_exists($pluginName, self::$mockingStrategies)) {
179
+        if ( ! array_key_exists($pluginName, self::$mockingStrategies)) {
180 180
             self::$mockingStrategies[$pluginName] = loadPlugin($pluginName);
181 181
         }
182 182
     }
Please login to merge, or discard this patch.
src/Strategy/AbstractMockingStrategy.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Strategy;
5 5
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     final protected static function checkDependencies(string $dependencyClassName, string $dependencyPackageName)
34 34
     {
35
-        if (!class_exists($dependencyClassName)) {
35
+        if ( ! class_exists($dependencyClassName)) {
36 36
             throw new MissingDependencyException(
37 37
                 sprintf(
38 38
                     'Class "%s" does not exist, please install package "%s"',
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     {
151 151
         $this->verifyMockType();
152 152
 
153
-        if (!is_a($mock, $this->mockType)) {
153
+        if ( ! is_a($mock, $this->mockType)) {
154 154
             throw new InvalidArgumentException(
155 155
                 sprintf(
156 156
                     'Mock object must be an instance of "%s", "%s" given',
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     private function verifyMockType(): void
170 170
     {
171
-        if (!$this->mockType) {
171
+        if ( ! $this->mockType) {
172 172
             throw new NotImplementedException('Mock type was not defined');
173 173
         }
174 174
     }
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -8,11 +8,9 @@
 block discarded – undo
8 8
 use Moka\Exception\MockNotCreatedException;
9 9
 use Moka\Exception\NotImplementedException;
10 10
 use function Moka\Factory\buildStubs;
11
-use Moka\Factory\StubFactory;
12 11
 use Moka\Stub\MethodStub;
13 12
 use Moka\Stub\PropertyStub;
14 13
 use Moka\Stub\StubInterface;
15
-use Moka\Stub\StubSet;
16 14
 
17 15
 /**
18 16
  * Class AbstractMockingStrategy
Please login to merge, or discard this patch.
src/Generator/Template/ClassTemplate.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Generator\Template;
5 5
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 
85 85
         foreach ($methods as $method) {
86 86
             if (
87
-                !$method->isFinal() &&
88
-                !\in_array($method->name, self::UNSAFE_METHODS, $strict = true)
87
+                ! $method->isFinal() &&
88
+                ! \in_array($method->name, self::UNSAFE_METHODS, $strict = true)
89 89
             ) {
90 90
                 $methodsCode[] = MethodTemplate::generate($method);
91 91
             }
Please login to merge, or discard this patch.
src/Plugin/Phake/Matcher/FirstStubMatcher.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Plugin\Phake\Matcher;
5 5
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $this->methodName = $methodName;
40 40
 
41 41
         $mockHash = spl_object_hash($mock);
42
-        if (!isset(self::$stubsPerMock[$mockHash])) {
42
+        if ( ! isset(self::$stubsPerMock[$mockHash])) {
43 43
             self::$stubsPerMock[$mockHash] = [];
44 44
         }
45 45
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     public function doArgumentsMatch(array &$arguments): void
60 60
     {
61
-        if (!$this->isFirstStub) {
61
+        if ( ! $this->isFirstStub) {
62 62
             throw new MethodMatcherException(
63 63
                 sprintf(
64 64
                     'Cannot override definition for method "%s()"',
Please login to merge, or discard this patch.
src/Stub/StubSet.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Stub;
5 5
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function add($elem): void
23 23
     {
24
-        if (!$elem instanceof StubInterface) {
24
+        if ( ! $elem instanceof StubInterface) {
25 25
             throw new InvalidArgumentException(
26 26
                 sprintf(
27 27
                     'Element must be an instance of "%s", "%s" given',
Please login to merge, or discard this patch.
src/Plugin/loadPlugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Plugin;
5 5
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function loadPlugin(string $pluginName): MockingStrategyInterface
23 23
 {
24
-    $generateFQCN = function (string $pluginName): string {
24
+    $generateFQCN = function(string $pluginName): string {
25 25
         return sprintf(
26 26
             PLUGIN_FQCN_TEMPLATE,
27 27
             ucfirst($pluginName),
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
     $pluginFQCN = $generateFQCN($pluginName);
33 33
 
34 34
     if (
35
-        !class_exists($pluginFQCN) ||
36
-        !\in_array(PluginInterface::class, class_implements($pluginFQCN), true)
35
+        ! class_exists($pluginFQCN) ||
36
+        ! \in_array(PluginInterface::class, class_implements($pluginFQCN), true)
37 37
     ) {
38 38
         throw new NotImplementedException(
39 39
             sprintf(
Please login to merge, or discard this patch.
src/Stub/Helper/validatePropertyName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Stub\Helper;
5 5
 
Please login to merge, or discard this patch.
src/Stub/Helper/isStaticName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Stub\Helper;
5 5
 
Please login to merge, or discard this patch.
src/Stub/Helper/validateMethodName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Moka\Stub\Helper;
5 5
 
Please login to merge, or discard this patch.