Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
asilgalis committed Jan 3, 2022
1 parent 9ab14f0 commit 759f696
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/M6Web/Component/RedisMock/RedisMockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,19 @@ protected function getMethodSignature(\ReflectionMethod $method)
$signatures = array();
foreach ($method->getParameters() as $parameter) {
$signature = '';
$parameterType = $parameter->getType();
$isReflectionNamedType = $parameterType instanceof \ReflectionNamedType;
// typeHint
if ($parameter->isArray()) {
if ($isReflectionNamedType && $parameterType->getName() === 'array') {
$signature .= 'array ';
} elseif (method_exists($parameter, 'isCallable') && $parameter->isCallable()) {
} elseif (
method_exists($parameter, 'isCallable')
&& $isReflectionNamedType
&& $parameterType->getName() === 'callable'
) {
$signature .= 'callable ';
} elseif ($parameter->getClass()) {
$signature .= sprintf('\%s ', $parameter->getClass());
} elseif ($isReflectionNamedType && $parameterType->getName() === 'object') {
$signature .= sprintf('\%s ', get_class($parameter));
}
// reference
if ($parameter->isPassedByReference()) {
Expand Down

0 comments on commit 759f696

Please sign in to comment.