mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-29 19:37:55 +01:00
Updated Rector to commit 165609bd78cf7dbb4889f4edd75cdb336c89c1aa
165609bd78
[FileProcessor] Add warning instead of skip InlineHTML on PhpFileProcessor (#4058)
This commit is contained in:
parent
7b17dd2d5b
commit
0ab58ff847
@ -23,6 +23,7 @@ use Rector\Core\ValueObject\Reporting\FileDiff;
|
||||
use Rector\Parallel\ValueObject\Bridge;
|
||||
use Rector\PostRector\Application\PostFileProcessor;
|
||||
use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment;
|
||||
use RectorPrefix202306\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Throwable;
|
||||
final class PhpFileProcessor implements FileProcessorInterface
|
||||
{
|
||||
@ -81,7 +82,12 @@ final class PhpFileProcessor implements FileProcessorInterface
|
||||
* @var \Rector\Core\FileSystem\FilePathHelper
|
||||
*/
|
||||
private $filePathHelper;
|
||||
public function __construct(FormatPerservingPrinter $formatPerservingPrinter, FileProcessor $fileProcessor, RemovedAndAddedFilesCollector $removedAndAddedFilesCollector, OutputStyleInterface $rectorOutputStyle, FileDiffFactory $fileDiffFactory, ChangedFilesDetector $changedFilesDetector, CurrentFileProvider $currentFileProvider, PostFileProcessor $postFileProcessor, ErrorFactory $errorFactory, FilePathHelper $filePathHelper)
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Symfony\Component\Console\Style\SymfonyStyle
|
||||
*/
|
||||
private $symfonyStyle;
|
||||
public function __construct(FormatPerservingPrinter $formatPerservingPrinter, FileProcessor $fileProcessor, RemovedAndAddedFilesCollector $removedAndAddedFilesCollector, OutputStyleInterface $rectorOutputStyle, FileDiffFactory $fileDiffFactory, ChangedFilesDetector $changedFilesDetector, CurrentFileProvider $currentFileProvider, PostFileProcessor $postFileProcessor, ErrorFactory $errorFactory, FilePathHelper $filePathHelper, SymfonyStyle $symfonyStyle)
|
||||
{
|
||||
$this->formatPerservingPrinter = $formatPerservingPrinter;
|
||||
$this->fileProcessor = $fileProcessor;
|
||||
@ -93,6 +99,7 @@ final class PhpFileProcessor implements FileProcessorInterface
|
||||
$this->postFileProcessor = $postFileProcessor;
|
||||
$this->errorFactory = $errorFactory;
|
||||
$this->filePathHelper = $filePathHelper;
|
||||
$this->symfonyStyle = $symfonyStyle;
|
||||
}
|
||||
/**
|
||||
* @return array{system_errors: SystemError[], file_diffs: FileDiff[]}
|
||||
@ -107,9 +114,9 @@ final class PhpFileProcessor implements FileProcessorInterface
|
||||
$systemErrorsAndFileDiffs[Bridge::SYSTEM_ERRORS] = $parsingSystemErrors;
|
||||
return $systemErrorsAndFileDiffs;
|
||||
}
|
||||
// skip HTML nodes, as unexpected
|
||||
// show warning on has InlineHTML node
|
||||
if ($file->hasInlineHTMLNode()) {
|
||||
return $systemErrorsAndFileDiffs;
|
||||
$this->symfonyStyle->warning(\sprintf('File %s has InlineHTML node, this may cause unexpected output, you may need to manually verify the changed file', $file->getFilePath()));
|
||||
}
|
||||
$fileHasChanged = \false;
|
||||
// 2. change nodes with Rectors
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '02b93319906ffa9842cbab8f80d58d8b5576cf43';
|
||||
public const PACKAGE_VERSION = '165609bd78cf7dbb4889f4edd75cdb336c89c1aa';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-06-04 11:10:01';
|
||||
public const RELEASE_DATE = '2023-06-04 17:54:54';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -15,7 +15,7 @@ final class RectorKernel
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const CACHE_KEY = 'v50';
|
||||
private const CACHE_KEY = 'v51';
|
||||
/**
|
||||
* @var \Symfony\Component\DependencyInjection\ContainerInterface|null
|
||||
*/
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit74ec1fce4be9fa253a71bae4bf69b3c0::getLoader();
|
||||
return ComposerAutoloaderInitcd0163760a7033769508443e609964ae::getLoader();
|
||||
|
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit74ec1fce4be9fa253a71bae4bf69b3c0
|
||||
class ComposerAutoloaderInitcd0163760a7033769508443e609964ae
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInit74ec1fce4be9fa253a71bae4bf69b3c0
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit74ec1fce4be9fa253a71bae4bf69b3c0', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcd0163760a7033769508443e609964ae', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit74ec1fce4be9fa253a71bae4bf69b3c0', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcd0163760a7033769508443e609964ae', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitcd0163760a7033769508443e609964ae::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitcd0163760a7033769508443e609964ae::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0
|
||||
class ComposerStaticInitcd0163760a7033769508443e609964ae
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3062,9 +3062,9 @@ class ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit74ec1fce4be9fa253a71bae4bf69b3c0::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitcd0163760a7033769508443e609964ae::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitcd0163760a7033769508443e609964ae::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitcd0163760a7033769508443e609964ae::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ if (!$stack) {
|
||||
try {
|
||||
$r = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
|
||||
$params = $r->getParameters();
|
||||
} catch (\Exception) {
|
||||
} catch (\Exception $exception) {
|
||||
$params = [];
|
||||
}
|
||||
foreach ($row['args'] as $k => $v) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user