upgraded dependencies

This commit is contained in:
RafficMohammed
2023-01-08 01:59:16 +05:30
parent 51056e3aad
commit f9ae387337
6895 changed files with 133617 additions and 178680 deletions

View File

@@ -1,15 +1,26 @@
<?php
<?php declare(strict_types=1);
/*
* This file is part of code-unit-reverse-lookup.
* This file is part of sebastian/code-unit-reverse-lookup.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SebastianBergmann\CodeUnitReverseLookup;
use function array_merge;
use function assert;
use function get_declared_classes;
use function get_declared_traits;
use function get_defined_functions;
use function is_array;
use function range;
use ReflectionClass;
use ReflectionFunction;
use ReflectionFunctionAbstract;
use ReflectionMethod;
/**
* @since Class available since Release 1.0.0
*/
@@ -44,25 +55,31 @@ class Wizard
if (isset($this->lookupTable[$filename][$lineNumber])) {
return $this->lookupTable[$filename][$lineNumber];
} else {
return $filename . ':' . $lineNumber;
}
return $filename . ':' . $lineNumber;
}
private function updateLookupTable()
private function updateLookupTable(): void
{
$this->processClassesAndTraits();
$this->processFunctions();
}
private function processClassesAndTraits()
private function processClassesAndTraits(): void
{
foreach (array_merge(get_declared_classes(), get_declared_traits()) as $classOrTrait) {
$classes = get_declared_classes();
$traits = get_declared_traits();
assert(is_array($classes));
assert(is_array($traits));
foreach (array_merge($classes, $traits) as $classOrTrait) {
if (isset($this->processedClasses[$classOrTrait])) {
continue;
}
$reflector = new \ReflectionClass($classOrTrait);
$reflector = new ReflectionClass($classOrTrait);
foreach ($reflector->getMethods() as $method) {
$this->processFunctionOrMethod($method);
@@ -72,23 +89,20 @@ class Wizard
}
}
private function processFunctions()
private function processFunctions(): void
{
foreach (get_defined_functions()['user'] as $function) {
if (isset($this->processedFunctions[$function])) {
continue;
}
$this->processFunctionOrMethod(new \ReflectionFunction($function));
$this->processFunctionOrMethod(new ReflectionFunction($function));
$this->processedFunctions[$function] = true;
}
}
/**
* @param \ReflectionFunctionAbstract $functionOrMethod
*/
private function processFunctionOrMethod(\ReflectionFunctionAbstract $functionOrMethod)
private function processFunctionOrMethod(ReflectionFunctionAbstract $functionOrMethod): void
{
if ($functionOrMethod->isInternal()) {
return;
@@ -96,7 +110,7 @@ class Wizard
$name = $functionOrMethod->getName();
if ($functionOrMethod instanceof \ReflectionMethod) {
if ($functionOrMethod instanceof ReflectionMethod) {
$name = $functionOrMethod->getDeclaringClass()->getName() . '::' . $name;
}