diff --git a/composer.json b/composer.json index 5637de2..984950b 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,12 @@ "php": "^7.4", "goaop/framework": "^3.0", "phpunit/phpunit": "^9.5", - "symfony/finder": ">=4.4 <6.0" + "symfony/finder": "^4.4 | ^5.4 | ^6.0" }, "require-dev": { "codeception/codeception": "^4.1", - "codeception/verify": "^2.1", - "codeception/specify": "^1.4", + "codeception/verify": "^2.2", + "codeception/specify": "^2.0", "consolidation/robo": "^3.0" } } diff --git a/src/AspectMock/Intercept/FunctionInjector.php b/src/AspectMock/Intercept/FunctionInjector.php index 5a41d90..6f17738 100644 --- a/src/AspectMock/Intercept/FunctionInjector.php +++ b/src/AspectMock/Intercept/FunctionInjector.php @@ -56,9 +56,9 @@ function __construct($namespace, $function) public function getParameterDeclaration(\ReflectionParameter $parameter, $internal) { $text = (string)$parameter; - if (preg_match('#Parameter\s\#\d+\s\[\s<(required|optional)>(.*)(\sor NULL)(.*)\s\]#', $text, $match)) { + if (preg_match('#Parameter\s\#\d+\s\[\s<(required|optional)>(.*)(\sor NULL)(.*)\s]#', $text, $match)) { $text = $match[2].$match[4]; - } elseif (preg_match('#Parameter\s\#\d+\s\[\s<(required|optional)>\s(.*)\s\]#', $text, $match)) { + } elseif (preg_match('#Parameter\s\#\d+\s\[\s<(required|optional)>\s(.*)\s]#', $text, $match)) { $text = $match[2]; } else { throw new Exception('reflection api changed. adjust code.'); diff --git a/src/AspectMock/Intercept/before_mock.php b/src/AspectMock/Intercept/before_mock.php index 15e767c..28bbea4 100644 --- a/src/AspectMock/Intercept/before_mock.php +++ b/src/AspectMock/Intercept/before_mock.php @@ -9,8 +9,7 @@ function __amock_before($class, $declaredClass, $method, $params, $static) { } function __amock_before_func($namespace, $func, $params) { - $res = Registry::$mocker->fakeFunctionAndRegisterCalls($namespace, $func, $params); - return $res; + return Registry::$mocker->fakeFunctionAndRegisterCalls($namespace, $func, $params); } const __AM_CONTINUE__ = '__am_continue__'; diff --git a/src/AspectMock/Kernel.php b/src/AspectMock/Kernel.php index 85859c8..fe76ee0 100644 --- a/src/AspectMock/Kernel.php +++ b/src/AspectMock/Kernel.php @@ -61,7 +61,7 @@ public function loadFile(string $file) protected function registerTransformers(): array { - $cachePathManager = $this->getContainer()->get('aspect.cache.path.manager');; + $cachePathManager = $this->getContainer()->get('aspect.cache.path.manager'); $sourceTransformers = [ new FilterInjectorTransformer($this, SourceTransformingLoader::getId(), $cachePathManager), @@ -80,4 +80,4 @@ protected function registerTransformers(): array } } -require __DIR__ . '/Intercept/before_mock.php'; \ No newline at end of file +require __DIR__ . '/Intercept/before_mock.php'; diff --git a/src/AspectMock/Proxy/AnythingClassProxy.php b/src/AspectMock/Proxy/AnythingClassProxy.php index 505810f..62c096b 100644 --- a/src/AspectMock/Proxy/AnythingClassProxy.php +++ b/src/AspectMock/Proxy/AnythingClassProxy.php @@ -8,9 +8,9 @@ class AnythingClassProxy extends ClassProxy { - public function __construct($class_name) + public function __construct($className) { - $this->className = $class_name; + $this->className = $className; $this->reflected = new ReflectionClass(Anything::class); } diff --git a/src/AspectMock/Proxy/ClassProxy.php b/src/AspectMock/Proxy/ClassProxy.php index 3f1a594..ffb8ada 100644 --- a/src/AspectMock/Proxy/ClassProxy.php +++ b/src/AspectMock/Proxy/ClassProxy.php @@ -47,10 +47,10 @@ class ClassProxy extends Verifier { protected ReflectionClass $reflected; - public function __construct($class_name) + public function __construct($className) { - $this->className = $class_name; - $this->reflected = new ReflectionClass($class_name); + $this->className = $className; + $this->reflected = new ReflectionClass($className); } public function getCallsForMethod($method) diff --git a/src/AspectMock/Test.php b/src/AspectMock/Test.php index 6b22383..7fda914 100644 --- a/src/AspectMock/Test.php +++ b/src/AspectMock/Test.php @@ -28,7 +28,7 @@ class Test { /** * `test::double` registers class or object to track its calls. - * In second argument you may pass values that mocked mathods should return. + * In second argument you may pass values that mocked methods should return. * * Returns either of [**ClassProxy**](https://github.com/Codeception/AspectMock/blob/master/docs/ClassProxy.md) (when a string was passed) * or [**InstanceProxy**](https://github.com/Codeception/AspectMock/blob/master/docs/InstanceProxy.md) (when an object was passed). @@ -267,7 +267,7 @@ public static function func(string $namespace, string $functionName, $body) * ``` * * @api - * @param string|object $classOrObject + * @param string|object $classOrInstance * @return void */ public static function clean($classOrInstance = null)