@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -8,11 +8,9 @@ |
||
| 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 |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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()"', |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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', |
@@ -1,5 +1,5 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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( |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Moka\Stub\Helper; |
| 5 | 5 | |
@@ -13,5 +13,5 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | function isMethodName(string $name): bool |
| 15 | 15 | { |
| 16 | - return !isPropertyName($name); |
|
| 16 | + return ! isPropertyName($name); |
|
| 17 | 17 | } |
| 18 | 18 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Moka\Stub\Helper; |
| 5 | 5 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Moka\Stub\Helper; |
| 5 | 5 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $methodName = sprintf( |
| 18 | 18 | '%s\is%sName', |
| 19 | 19 | __NAMESPACE__, |
| 20 | - ucfirst((string) $type) |
|
| 20 | + ucfirst((string)$type) |
|
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | 23 | $isAPrefix = array_key_exists($type, PREFIXES); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | ? $methodName($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', |