Completed
Pull Request — master (#49)
by Alberto
02:39
created
src/Plugin/loadPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -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/Plugin/Phake/Matcher/FirstStubMatcher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -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/Moka.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $backtrace = debug_backtrace();
133 133
         foreach ($backtrace as $frame) {
134
-            if (!isset($frame['object'])) {
134
+            if ( ! isset($frame['object'])) {
135 135
                 continue;
136 136
             }
137 137
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     private static function ensurePluginLoad(string $pluginName): void
181 181
     {
182
-        if (!array_key_exists($pluginName, self::$mockingStrategies)) {
182
+        if ( ! array_key_exists($pluginName, self::$mockingStrategies)) {
183 183
             self::$mockingStrategies[$pluginName] = loadPlugin($pluginName);
184 184
         }
185 185
     }
Please login to merge, or discard this patch.
src/Strategy/AbstractMockingStrategy.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     final protected static function checkDependencies(string $dependencyClassName, string $dependencyPackageName)
35 35
     {
36
-        if (!class_exists($dependencyClassName)) {
36
+        if ( ! class_exists($dependencyClassName)) {
37 37
             throw new MissingDependencyException(
38 38
                 sprintf(
39 39
                     'Class "%s" does not exist, please install package "%s"',
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         $this->verifyMockType();
153 153
 
154
-        if (!is_a($mock, $this->mockType)) {
154
+        if ( ! is_a($mock, $this->mockType)) {
155 155
             throw new InvalidArgumentException(
156 156
                 sprintf(
157 157
                     'Mock object must be an instance of "%s", "%s" given',
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      */
170 170
     private function verifyMockType(): void
171 171
     {
172
-        if (!$this->mockType) {
172
+        if ( ! $this->mockType) {
173 173
             throw new NotImplementedException('Mock type was not defined');
174 174
         }
175 175
     }
Please login to merge, or discard this patch.
src/Stub/StubSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 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/Stub/Helper/isMethodName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,5 +13,5 @@
 block discarded – undo
13 13
  */
14 14
 function isMethodName(string $name): bool
15 15
 {
16
-    return !isPropertyName($name);
16
+    return ! isPropertyName($name);
17 17
 }
Please login to merge, or discard this patch.
src/Stub/Helper/validateName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         ? $functionName($name)
26 26
         : preg_match(REGEX_NAME, $name);
27 27
 
28
-    if (!$nameIsValid) {
28
+    if ( ! $nameIsValid) {
29 29
         $message = $isAPrefix
30 30
             ? sprintf(
31 31
                 'Name must be prefixed by "%s", "%s" given',
Please login to merge, or discard this patch.
src/Stub/Helper/stripName.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         ? array_intersect(array_keys(PREFIXES), $prefixes)
15 15
         : array_keys(PREFIXES);
16 16
 
17
-    return array_reduce($prefixes, function (string $name, string $prefix) {
17
+    return array_reduce($prefixes, function(string $name, string $prefix) {
18 18
         return preg_replace(
19 19
             sprintf(TEMPLATE_NAME, PREFIXES[$prefix]),
20 20
             '',
Please login to merge, or discard this patch.