Updated Rector to commit be1cdc059d

be1cdc059d Documenting a solution for missing classes (#889)
This commit is contained in:
Tomas Votruba 2021-09-15 18:23:02 +00:00
parent 6d77d9e9fd
commit 96d71cf14e
6 changed files with 35 additions and 20 deletions

View File

@ -74,4 +74,19 @@ If the false positive still happen, you can skip the rule applied as last resort
__DIR__ . '/src/HasChildClass.php',
],
]);
```
```
### Dealing with "Class ... was not found while trying to analyse it..."
Sometimes you may encounter this error ([see here for an example](https://github.com/rectorphp/rector/issues/6688)) even if the class is there and it seems to work properly with other tools (e.g. PHPStan).
In this case you may want to try one of the following solutions:
```php
$parameters->set(Option::AUTOLOAD_PATHS, [
// the path to the exact class file
__DIR__ . '/vendor/acme/my-custom-dependency/src/Your/Own/Namespace/TheAffectedClass.php',
// or you can specify a wider scope
__DIR__ . '/vendor/acme/my-custom-dependency/src',
// WARNING: beware of performances, try to narrow down the path
// as much as you can or you will slow down each run
]);
```

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'ae01efed9cfc6a429779090a0b23f500ca9cb81d';
public const PACKAGE_VERSION = 'be1cdc059de69fc6f3f2f51644182684904d1004';
/**
* @var string
*/
public const RELEASE_DATE = '2021-09-15 15:26:32';
public const RELEASE_DATE = '2021-09-15 18:10:24';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20210915\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782::getLoader();
return ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782
class ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitd8c609e2b38c1ae391681cb466cce247::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitd8c609e2b38c1ae391681cb466cce247::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire8f0ce8883c186b7853c16dffd91dd782($fileIdentifier, $file);
composerRequired8c609e2b38c1ae391681cb466cce247($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire8f0ce8883c186b7853c16dffd91dd782($fileIdentifier, $file)
function composerRequired8c609e2b38c1ae391681cb466cce247($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782
class ComposerStaticInitd8c609e2b38c1ae391681cb466cce247
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3858,9 +3858,9 @@ class ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit8f0ce8883c186b7853c16dffd91dd782::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitd8c609e2b38c1ae391681cb466cce247::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitd8c609e2b38c1ae391681cb466cce247::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitd8c609e2b38c1ae391681cb466cce247::$classMap;
}, null, ClassLoader::class);
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20210915\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782', false) && !interface_exists('ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782', false) && !trait_exists('ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782', false)) {
spl_autoload_call('RectorPrefix20210915\ComposerAutoloaderInit8f0ce8883c186b7853c16dffd91dd782');
if (!class_exists('ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247', false) && !interface_exists('ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247', false) && !trait_exists('ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247', false)) {
spl_autoload_call('RectorPrefix20210915\ComposerAutoloaderInitd8c609e2b38c1ae391681cb466cce247');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20210915\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3311,9 +3311,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20210915\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire8f0ce8883c186b7853c16dffd91dd782')) {
function composerRequire8f0ce8883c186b7853c16dffd91dd782() {
return \RectorPrefix20210915\composerRequire8f0ce8883c186b7853c16dffd91dd782(...func_get_args());
if (!function_exists('composerRequired8c609e2b38c1ae391681cb466cce247')) {
function composerRequired8c609e2b38c1ae391681cb466cce247() {
return \RectorPrefix20210915\composerRequired8c609e2b38c1ae391681cb466cce247(...func_get_args());
}
}
if (!function_exists('parseArgs')) {