Skip to content

Commit

Permalink
Update dependencies (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
TavoNiievez authored Dec 18, 2021
1 parent 345dff6 commit b15254b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
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

0 comments on commit b15254b

Please sign in to comment.