Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #198

Merged
merged 1 commit into from
Dec 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 2 additions & 2 deletions src/AspectMock/Intercept/FunctionInjector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
Expand Down
3 changes: 1 addition & 2 deletions src/AspectMock/Intercept/before_mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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__';
4 changes: 2 additions & 2 deletions src/AspectMock/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -80,4 +80,4 @@ protected function registerTransformers(): array
}
}

require __DIR__ . '/Intercept/before_mock.php';
require __DIR__ . '/Intercept/before_mock.php';
4 changes: 2 additions & 2 deletions src/AspectMock/Proxy/AnythingClassProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions src/AspectMock/Proxy/ClassProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/AspectMock/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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)
Expand Down