mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
Updated Rector to commit 08ccd5a1a4f8757ff8f392c0e823a02bc95c14c1
08ccd5a1a4
[DX] Remove the composer upgrade as unused to narrow focus back to PHP (#2865)
This commit is contained in:
parent
4a341c0b42
commit
7b90cd54eb
@ -44,9 +44,11 @@ use Rector\PSR4\Composer\PSR4NamespaceMatcher;
|
||||
use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface;
|
||||
use Rector\Utils\Command\MissingInSetCommand;
|
||||
use RectorPrefix202208\Symfony\Component\Console\Application;
|
||||
use RectorPrefix202208\Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use function RectorPrefix202208\Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
||||
use RectorPrefix202208\Symfony\Component\Filesystem\Filesystem;
|
||||
use RectorPrefix202208\Symplify\EasyParallel\ValueObject\EasyParallelConfig;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\Console\Style\SymfonyStyleFactory;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\Parameter\ParameterProvider;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\Php\TypeChecker;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\Reflection\PrivatesAccessor;
|
||||
@ -129,9 +131,9 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
$services->set(Inflector::class)->factory([service(InflectorFactory::class), 'build']);
|
||||
$services->set(VersionParser::class);
|
||||
$services->set(TypeChecker::class);
|
||||
// phpdoc parser
|
||||
$services->set(\PHPStan\PhpDocParser\Lexer\Lexer::class);
|
||||
$services->alias(PhpDocParser::class, BetterPhpDocParser::class);
|
||||
// console
|
||||
$services->set(SymfonyStyleFactory::class);
|
||||
$services->set(SymfonyStyle::class)->factory([service(SymfonyStyleFactory::class), 'create']);
|
||||
// cache
|
||||
$services->set(DependencyResolver::class)->factory([service(PHPStanServicesFactory::class), 'createDependencyResolver']);
|
||||
$services->set(FileHelper::class)->factory([service(PHPStanServicesFactory::class), 'createFileHelper']);
|
||||
@ -152,6 +154,7 @@ return static function (RectorConfig $rectorConfig) : void {
|
||||
$services->set(NodeFinder::class);
|
||||
// phpdoc parser
|
||||
$services->set(PhpDocParser::class);
|
||||
$services->alias(PhpDocParser::class, BetterPhpDocParser::class);
|
||||
$services->set(\PHPStan\PhpDocParser\Lexer\Lexer::class);
|
||||
$services->set(TypeParser::class);
|
||||
$services->set(ConstExprParser::class);
|
||||
|
@ -1,51 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\PhpDocParser\PhpDocParser;
|
||||
|
||||
use PhpParser\Comment\Doc;
|
||||
use PhpParser\Node;
|
||||
use PHPStan\PhpDocParser\Lexer\Lexer;
|
||||
use PHPStan\PhpDocParser\Parser\PhpDocParser;
|
||||
use PHPStan\PhpDocParser\Parser\TokenIterator;
|
||||
use Rector\PhpDocParser\PhpDocParser\ValueObject\Ast\PhpDoc\SimplePhpDocNode;
|
||||
/**
|
||||
* @api
|
||||
* @see \Rector\Tests\PhpDocParser\PhpDocParser\SimplePhpDocParser\SimplePhpDocParserTest
|
||||
*/
|
||||
final class SimplePhpDocParser
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PHPStan\PhpDocParser\Parser\PhpDocParser
|
||||
*/
|
||||
private $phpDocParser;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \PHPStan\PhpDocParser\Lexer\Lexer
|
||||
*/
|
||||
private $lexer;
|
||||
public function __construct(PhpDocParser $phpDocParser, Lexer $lexer)
|
||||
{
|
||||
$this->phpDocParser = $phpDocParser;
|
||||
$this->lexer = $lexer;
|
||||
}
|
||||
public function parseNode(Node $node) : ?SimplePhpDocNode
|
||||
{
|
||||
$docComment = $node->getDocComment();
|
||||
if (!$docComment instanceof Doc) {
|
||||
return null;
|
||||
}
|
||||
return $this->parseDocBlock($docComment->getText());
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
public function parseDocBlock(string $docBlock) : SimplePhpDocNode
|
||||
{
|
||||
$tokens = $this->lexer->tokenize($docBlock);
|
||||
$tokenIterator = new TokenIterator($tokens);
|
||||
$phpDocNode = $this->phpDocParser->parse($tokenIterator);
|
||||
return new SimplePhpDocNode($phpDocNode->children);
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\PhpDocParser\PhpDocParser\StaticFactory;
|
||||
|
||||
use PHPStan\PhpDocParser\Lexer\Lexer;
|
||||
use PHPStan\PhpDocParser\Parser\ConstExprParser;
|
||||
use PHPStan\PhpDocParser\Parser\PhpDocParser;
|
||||
use PHPStan\PhpDocParser\Parser\TypeParser;
|
||||
use Rector\PhpDocParser\PhpDocParser\SimplePhpDocParser;
|
||||
/**
|
||||
* @api
|
||||
*/
|
||||
final class SimplePhpDocParserStaticFactory
|
||||
{
|
||||
public static function create() : SimplePhpDocParser
|
||||
{
|
||||
$phpDocParser = new PhpDocParser(new TypeParser(), new ConstExprParser());
|
||||
return new SimplePhpDocParser($phpDocParser, new Lexer());
|
||||
}
|
||||
}
|
@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Application\FileProcessor;
|
||||
|
||||
use Rector\ChangesReporting\ValueObjectFactory\FileDiffFactory;
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Core\Contract\Processor\FileProcessorInterface;
|
||||
use Rector\Core\ValueObject\Application\File;
|
||||
use Rector\Core\ValueObject\Configuration;
|
||||
use Rector\Core\ValueObject\Error\SystemError;
|
||||
use Rector\Core\ValueObject\Reporting\FileDiff;
|
||||
use Rector\Parallel\ValueObject\Bridge;
|
||||
use Rector\Testing\PHPUnit\StaticPHPUnitEnvironment;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ComposerJsonFactory;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\Printer\ComposerJsonPrinter;
|
||||
use Symplify\SmartFileSystem\SmartFileInfo;
|
||||
final class ComposerFileProcessor implements FileProcessorInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Symplify\ComposerJsonManipulator\ComposerJsonFactory
|
||||
*/
|
||||
private $composerJsonFactory;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Symplify\ComposerJsonManipulator\Printer\ComposerJsonPrinter
|
||||
*/
|
||||
private $composerJsonPrinter;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\ChangesReporting\ValueObjectFactory\FileDiffFactory
|
||||
*/
|
||||
private $fileDiffFactory;
|
||||
/**
|
||||
* @var ComposerRectorInterface[]
|
||||
* @readonly
|
||||
*/
|
||||
private $composerRectors;
|
||||
/**
|
||||
* @param ComposerRectorInterface[] $composerRectors
|
||||
*/
|
||||
public function __construct(ComposerJsonFactory $composerJsonFactory, ComposerJsonPrinter $composerJsonPrinter, FileDiffFactory $fileDiffFactory, array $composerRectors)
|
||||
{
|
||||
$this->composerJsonFactory = $composerJsonFactory;
|
||||
$this->composerJsonPrinter = $composerJsonPrinter;
|
||||
$this->fileDiffFactory = $fileDiffFactory;
|
||||
$this->composerRectors = $composerRectors;
|
||||
}
|
||||
/**
|
||||
* @return array{system_errors: SystemError[], file_diffs: FileDiff[]}
|
||||
*/
|
||||
public function process(File $file, Configuration $configuration) : array
|
||||
{
|
||||
$systemErrorsAndFileDiffs = [Bridge::SYSTEM_ERRORS => [], Bridge::FILE_DIFFS => []];
|
||||
if ($this->composerRectors === []) {
|
||||
return $systemErrorsAndFileDiffs;
|
||||
}
|
||||
// to avoid modification of file
|
||||
$smartFileInfo = $file->getSmartFileInfo();
|
||||
$oldFileContents = $smartFileInfo->getContents();
|
||||
$composerJson = $this->composerJsonFactory->createFromFileInfo($smartFileInfo);
|
||||
$oldComposerJson = clone $composerJson;
|
||||
foreach ($this->composerRectors as $composerRector) {
|
||||
$composerRector->refactor($composerJson);
|
||||
}
|
||||
// nothing has changed
|
||||
if ($oldComposerJson->getJsonArray() === $composerJson->getJsonArray()) {
|
||||
return $systemErrorsAndFileDiffs;
|
||||
}
|
||||
$changedFileContent = $this->composerJsonPrinter->printToString($composerJson);
|
||||
$file->changeFileContent($changedFileContent);
|
||||
$fileDiff = $this->fileDiffFactory->createFileDiff($file, $oldFileContents, $changedFileContent);
|
||||
$systemErrorsAndFileDiffs[Bridge::FILE_DIFFS] = [$fileDiff];
|
||||
return $systemErrorsAndFileDiffs;
|
||||
}
|
||||
public function supports(File $file, Configuration $configuration) : bool
|
||||
{
|
||||
$smartFileInfo = $file->getSmartFileInfo();
|
||||
if ($this->isJsonInTests($smartFileInfo)) {
|
||||
return \true;
|
||||
}
|
||||
return $smartFileInfo->getBasename() === 'composer.json';
|
||||
}
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getSupportedFileExtensions() : array
|
||||
{
|
||||
return ['json'];
|
||||
}
|
||||
private function isJsonInTests(SmartFileInfo $fileInfo) : bool
|
||||
{
|
||||
if (!StaticPHPUnitEnvironment::isPHPUnitRun()) {
|
||||
return \false;
|
||||
}
|
||||
return $fileInfo->hasSuffixes(['json']);
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Contract\Rector;
|
||||
|
||||
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
|
||||
use Rector\Core\Contract\Rector\RectorInterface;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
interface ComposerRectorInterface extends RectorInterface, ConfigurableRectorInterface
|
||||
{
|
||||
public function refactor(ComposerJson $composerJson) : void;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Contract;
|
||||
|
||||
interface VersionAwareInterface
|
||||
{
|
||||
public function getVersion() : string;
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Guard;
|
||||
|
||||
use RectorPrefix202208\Composer\Semver\VersionParser;
|
||||
use Rector\Composer\Contract\VersionAwareInterface;
|
||||
final class VersionGuard
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Composer\Semver\VersionParser
|
||||
*/
|
||||
private $versionParser;
|
||||
public function __construct(VersionParser $versionParser)
|
||||
{
|
||||
$this->versionParser = $versionParser;
|
||||
}
|
||||
/**
|
||||
* @param VersionAwareInterface[] $versionAwares
|
||||
*/
|
||||
public function validate(array $versionAwares) : void
|
||||
{
|
||||
foreach ($versionAwares as $versionAware) {
|
||||
$this->versionParser->parseConstraints($versionAware->getVersion());
|
||||
}
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Composer\Guard\VersionGuard;
|
||||
use Rector\Composer\ValueObject\PackageAndVersion;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\AddPackageToRequireComposerRector\AddPackageToRequireComposerRectorTest
|
||||
*/
|
||||
final class AddPackageToRequireComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var PackageAndVersion[]
|
||||
*/
|
||||
private $packagesAndVersions = [];
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Composer\Guard\VersionGuard
|
||||
*/
|
||||
private $versionGuard;
|
||||
public function __construct(VersionGuard $versionGuard)
|
||||
{
|
||||
$this->versionGuard = $versionGuard;
|
||||
}
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->packagesAndVersions as $packageAndVersion) {
|
||||
$composerJson->addRequiredPackage($packageAndVersion->getPackageName(), $packageAndVersion->getVersion());
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add package to "require" in `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"symfony/console": "^3.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [new PackageAndVersion('symfony/console', '^3.4')])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allIsAOf($configuration, PackageAndVersion::class);
|
||||
$this->versionGuard->validate($configuration);
|
||||
$this->packagesAndVersions = $configuration;
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Composer\Guard\VersionGuard;
|
||||
use Rector\Composer\ValueObject\PackageAndVersion;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\AddPackageToRequireDevComposerRector\AddPackageToRequireDevComposerRectorTest
|
||||
*/
|
||||
final class AddPackageToRequireDevComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var PackageAndVersion[]
|
||||
*/
|
||||
private $packageAndVersions = [];
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Composer\Guard\VersionGuard
|
||||
*/
|
||||
private $versionGuard;
|
||||
public function __construct(VersionGuard $versionGuard)
|
||||
{
|
||||
$this->versionGuard = $versionGuard;
|
||||
}
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->packageAndVersions as $packageAndVersion) {
|
||||
$composerJson->addRequiredDevPackage($packageAndVersion->getPackageName(), $packageAndVersion->getVersion());
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Add package to "require-dev" in `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
"require-dev": {
|
||||
"symfony/console": "^3.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [new PackageAndVersion('symfony/console', '^3.4')])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allIsAOf($configuration, PackageAndVersion::class);
|
||||
$this->versionGuard->validate($configuration);
|
||||
$this->packageAndVersions = $configuration;
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Composer\Guard\VersionGuard;
|
||||
use Rector\Composer\ValueObject\PackageAndVersion;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\ChangePackageVersionComposerRector\ChangePackageVersionComposerRectorTest
|
||||
*/
|
||||
final class ChangePackageVersionComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var PackageAndVersion[]
|
||||
*/
|
||||
private $packagesAndVersions = [];
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Composer\Guard\VersionGuard
|
||||
*/
|
||||
private $versionGuard;
|
||||
public function __construct(VersionGuard $versionGuard)
|
||||
{
|
||||
$this->versionGuard = $versionGuard;
|
||||
}
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->packagesAndVersions as $packageAndVersion) {
|
||||
$composerJson->changePackageVersion($packageAndVersion->getPackageName(), $packageAndVersion->getVersion());
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Change package version `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"symfony/console": "^3.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"symfony/console": "^4.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [new PackageAndVersion('symfony/console', '^4.4')])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allIsAOf($configuration, PackageAndVersion::class);
|
||||
$this->versionGuard->validate($configuration);
|
||||
$this->packagesAndVersions = $configuration;
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\RemovePackageComposerRector\RemovePackageComposerRectorTest
|
||||
*/
|
||||
final class RemovePackageComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var string[]
|
||||
*/
|
||||
private $packageNames = [];
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->packageNames as $packageName) {
|
||||
$composerJson->removePackage($packageName);
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Remove package from "require" and "require-dev" in `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"symfony/console": "^3.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, ['symfony/console'])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allString($configuration);
|
||||
$this->packageNames = $configuration;
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Composer\ValueObject\RenamePackage;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\RenamePackageComposerRector\RenamePackageComposerRectorTest
|
||||
*/
|
||||
final class RenamePackageComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var RenamePackage[]
|
||||
*/
|
||||
private $renamePackages = [];
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->renamePackages as $renamePackage) {
|
||||
if ($composerJson->hasRequiredPackage($renamePackage->getOldPackageName())) {
|
||||
$version = $composerJson->getRequire()[$renamePackage->getOldPackageName()];
|
||||
$composerJson->replacePackage($renamePackage->getOldPackageName(), $renamePackage->getNewPackageName(), $version);
|
||||
}
|
||||
if ($composerJson->hasRequiredDevPackage($renamePackage->getOldPackageName())) {
|
||||
$version = $composerJson->getRequireDev()[$renamePackage->getOldPackageName()];
|
||||
$composerJson->replacePackage($renamePackage->getOldPackageName(), $renamePackage->getNewPackageName(), $version);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Change package name in `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"rector/rector": "dev-main"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
"require": {
|
||||
"rector/rector-src": "dev-main"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [new RenamePackage('rector/rector', 'rector/rector-src')])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allIsAOf($configuration, RenamePackage::class);
|
||||
$this->renamePackages = $configuration;
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\Rector;
|
||||
|
||||
use Rector\Composer\Contract\Rector\ComposerRectorInterface;
|
||||
use Rector\Composer\Guard\VersionGuard;
|
||||
use Rector\Composer\ValueObject\ReplacePackageAndVersion;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson;
|
||||
use Symplify\RuleDocGenerator\ValueObject\CodeSample\ConfiguredCodeSample;
|
||||
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
/**
|
||||
* @see \Rector\Tests\Composer\Rector\ReplacePackageAndVersionComposerRector\ReplacePackageAndVersionComposerRectorTest
|
||||
*/
|
||||
final class ReplacePackageAndVersionComposerRector implements ComposerRectorInterface
|
||||
{
|
||||
/**
|
||||
* @var ReplacePackageAndVersion[]
|
||||
*/
|
||||
private $replacePackagesAndVersions = [];
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Rector\Composer\Guard\VersionGuard
|
||||
*/
|
||||
private $versionGuard;
|
||||
public function __construct(VersionGuard $versionGuard)
|
||||
{
|
||||
$this->versionGuard = $versionGuard;
|
||||
}
|
||||
public function refactor(ComposerJson $composerJson) : void
|
||||
{
|
||||
foreach ($this->replacePackagesAndVersions as $replacePackageAndVersion) {
|
||||
$composerJson->replacePackage($replacePackageAndVersion->getOldPackageName(), $replacePackageAndVersion->getNewPackageName(), $replacePackageAndVersion->getVersion());
|
||||
}
|
||||
}
|
||||
public function getRuleDefinition() : RuleDefinition
|
||||
{
|
||||
return new RuleDefinition('Change package name and version `composer.json`', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
|
||||
{
|
||||
"require-dev": {
|
||||
"symfony/console": "^3.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, <<<'CODE_SAMPLE'
|
||||
{
|
||||
"require-dev": {
|
||||
"symfony/http-kernel": "^4.4"
|
||||
}
|
||||
}
|
||||
CODE_SAMPLE
|
||||
, [new ReplacePackageAndVersion('symfony/console', 'symfony/http-kernel', '^4.4')])]);
|
||||
}
|
||||
/**
|
||||
* @param mixed[] $configuration
|
||||
*/
|
||||
public function configure(array $configuration) : void
|
||||
{
|
||||
Assert::allIsAOf($configuration, ReplacePackageAndVersion::class);
|
||||
$this->versionGuard->validate($configuration);
|
||||
$this->replacePackagesAndVersions = $configuration;
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\ValueObject;
|
||||
|
||||
use Rector\Composer\Contract\VersionAwareInterface;
|
||||
final class PackageAndVersion implements VersionAwareInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $packageName;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $version;
|
||||
public function __construct(string $packageName, string $version)
|
||||
{
|
||||
$this->packageName = $packageName;
|
||||
$this->version = $version;
|
||||
}
|
||||
public function getPackageName() : string
|
||||
{
|
||||
return $this->packageName;
|
||||
}
|
||||
public function getVersion() : string
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\ValueObject;
|
||||
|
||||
final class RenamePackage
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $oldPackageName;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $newPackageName;
|
||||
public function __construct(string $oldPackageName, string $newPackageName)
|
||||
{
|
||||
$this->oldPackageName = $oldPackageName;
|
||||
$this->newPackageName = $newPackageName;
|
||||
}
|
||||
public function getOldPackageName() : string
|
||||
{
|
||||
return $this->oldPackageName;
|
||||
}
|
||||
public function getNewPackageName() : string
|
||||
{
|
||||
return $this->newPackageName;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare (strict_types=1);
|
||||
namespace Rector\Composer\ValueObject;
|
||||
|
||||
use Rector\Composer\Contract\VersionAwareInterface;
|
||||
use Rector\Composer\Rector\ChangePackageVersionComposerRector;
|
||||
use RectorPrefix202208\Webmozart\Assert\Assert;
|
||||
final class ReplacePackageAndVersion implements VersionAwareInterface
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $oldPackageName;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $newPackageName;
|
||||
/**
|
||||
* @readonly
|
||||
* @var string
|
||||
*/
|
||||
private $version;
|
||||
public function __construct(string $oldPackageName, string $newPackageName, string $version)
|
||||
{
|
||||
$this->version = $version;
|
||||
Assert::notSame($oldPackageName, $newPackageName, 'Old and new package have to be different. If you want to only change package version, use ' . ChangePackageVersionComposerRector::class);
|
||||
$this->oldPackageName = $oldPackageName;
|
||||
$this->newPackageName = $newPackageName;
|
||||
}
|
||||
public function getOldPackageName() : string
|
||||
{
|
||||
return $this->oldPackageName;
|
||||
}
|
||||
public function getNewPackageName() : string
|
||||
{
|
||||
return $this->newPackageName;
|
||||
}
|
||||
public function getVersion() : string
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ namespace Rector\PSR4\Composer;
|
||||
|
||||
use RectorPrefix202208\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202208\Nette\Utils\Json;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJsonSection;
|
||||
final class PSR4AutoloadPathsProvider
|
||||
{
|
||||
/**
|
||||
@ -22,7 +21,7 @@ final class PSR4AutoloadPathsProvider
|
||||
}
|
||||
$fileContents = FileSystem::read($this->getComposerJsonPath());
|
||||
$composerJson = Json::decode($fileContents, Json::FORCE_ARRAY);
|
||||
$psr4Autoloads = \array_merge($composerJson[ComposerJsonSection::AUTOLOAD]['psr-4'] ?? [], $composerJson[ComposerJsonSection::AUTOLOAD_DEV]['psr-4'] ?? []);
|
||||
$psr4Autoloads = \array_merge($composerJson['autoload']['psr-4'] ?? [], $composerJson['autoload-dev']['psr-4'] ?? []);
|
||||
$this->cachedComposerJsonPSR4AutoloadPaths = $this->removeEmptyNamespaces($psr4Autoloads);
|
||||
return $this->cachedComposerJsonPSR4AutoloadPaths;
|
||||
}
|
||||
|
@ -81,7 +81,6 @@ final class RemoveExtraParametersRector extends AbstractRector implements MinPhp
|
||||
}
|
||||
}
|
||||
$maximumAllowedParameterCount = $this->resolveMaximumAllowedParameterCount($functionLikeReflection);
|
||||
//
|
||||
if ($node->isFirstClassCallable()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -17,12 +17,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'f91dba4a7f015ce11123abf065e43c7b0b53e243';
|
||||
public const PACKAGE_VERSION = '08ccd5a1a4f8757ff8f392c0e823a02bc95c14c1';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2022-08-31 10:41:55';
|
||||
public const RELEASE_DATE = '2022-08-31 08:58:15';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -13,7 +13,6 @@ use Rector\Core\Exception\ShouldNotHappenException;
|
||||
use RectorPrefix202208\Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use RectorPrefix202208\Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use RectorPrefix202208\Symplify\AutowireArrayParameter\DependencyInjection\CompilerPass\AutowireArrayParameterCompilerPass;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJsonManipulatorConfig;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\DependencyInjection\CompilerPass\AutowireInterfacesCompilerPass;
|
||||
use RectorPrefix202208\Symplify\PackageBuilder\ValueObject\ConsoleColorDiffConfig;
|
||||
use RectorPrefix202208\Symplify\Skipper\ValueObject\SkipperConfig;
|
||||
@ -81,6 +80,6 @@ final class RectorKernel implements LightKernelInterface
|
||||
*/
|
||||
private function createDefaultConfigFiles() : array
|
||||
{
|
||||
return [__DIR__ . '/../../config/config.php', ComposerJsonManipulatorConfig::FILE_PATH, SkipperConfig::FILE_PATH, ConsoleColorDiffConfig::FILE_PATH];
|
||||
return [__DIR__ . '/../../config/config.php', SkipperConfig::FILE_PATH, ConsoleColorDiffConfig::FILE_PATH];
|
||||
}
|
||||
}
|
||||
|
@ -4,18 +4,14 @@ declare (strict_types=1);
|
||||
namespace Rector\Core\Php\PhpVersionResolver;
|
||||
|
||||
use RectorPrefix202208\Composer\Semver\VersionParser;
|
||||
use RectorPrefix202208\Nette\Utils\FileSystem;
|
||||
use RectorPrefix202208\Nette\Utils\Json;
|
||||
use Rector\Core\Util\PhpVersionFactory;
|
||||
use RectorPrefix202208\Symplify\ComposerJsonManipulator\ComposerJsonFactory;
|
||||
/**
|
||||
* @see \Rector\Core\Tests\Php\PhpVersionResolver\ProjectComposerJsonPhpVersionResolver\ProjectComposerJsonPhpVersionResolverTest
|
||||
*/
|
||||
final class ProjectComposerJsonPhpVersionResolver
|
||||
{
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Symplify\ComposerJsonManipulator\ComposerJsonFactory
|
||||
*/
|
||||
private $composerJsonFactory;
|
||||
/**
|
||||
* @readonly
|
||||
* @var \Composer\Semver\VersionParser
|
||||
@ -26,21 +22,21 @@ final class ProjectComposerJsonPhpVersionResolver
|
||||
* @var \Rector\Core\Util\PhpVersionFactory
|
||||
*/
|
||||
private $phpVersionFactory;
|
||||
public function __construct(ComposerJsonFactory $composerJsonFactory, VersionParser $versionParser, PhpVersionFactory $phpVersionFactory)
|
||||
public function __construct(VersionParser $versionParser, PhpVersionFactory $phpVersionFactory)
|
||||
{
|
||||
$this->composerJsonFactory = $composerJsonFactory;
|
||||
$this->versionParser = $versionParser;
|
||||
$this->phpVersionFactory = $phpVersionFactory;
|
||||
}
|
||||
public function resolve(string $composerJson) : ?int
|
||||
{
|
||||
$projectComposerJson = $this->composerJsonFactory->createFromFilePath($composerJson);
|
||||
$composerJsonContents = FileSystem::read($composerJson);
|
||||
$projectComposerJson = Json::decode($composerJsonContents, Json::FORCE_ARRAY);
|
||||
// see https://getcomposer.org/doc/06-config.md#platform
|
||||
$platformPhp = $projectComposerJson->getConfig()['platform']['php'] ?? null;
|
||||
$platformPhp = $projectComposerJson['config']['platform']['php'] ?? null;
|
||||
if ($platformPhp !== null) {
|
||||
return $this->phpVersionFactory->createIntVersion($platformPhp);
|
||||
}
|
||||
$requirePhpVersion = $projectComposerJson->getRequirePhpVersion();
|
||||
$requirePhpVersion = $projectComposerJson['require']['php'] ?? null;
|
||||
if ($requirePhpVersion === null) {
|
||||
return null;
|
||||
}
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b::getLoader();
|
||||
return ComposerAutoloaderInitf3134b9ed12cab2fbd4484930fa12946::getLoader();
|
||||
|
15
vendor/composer/autoload_classmap.php
vendored
15
vendor/composer/autoload_classmap.php
vendored
@ -1373,19 +1373,6 @@ return array(
|
||||
'Rector\\Compatibility\\NodeFactory\\ConstructorClassMethodFactory' => $baseDir . '/rules/Compatibility/NodeFactory/ConstructorClassMethodFactory.php',
|
||||
'Rector\\Compatibility\\Rector\\Class_\\AttributeCompatibleAnnotationRector' => $baseDir . '/rules/Compatibility/Rector/Class_/AttributeCompatibleAnnotationRector.php',
|
||||
'Rector\\Compatibility\\ValueObject\\PropertyWithPhpDocInfo' => $baseDir . '/rules/Compatibility/ValueObject/PropertyWithPhpDocInfo.php',
|
||||
'Rector\\Composer\\Application\\FileProcessor\\ComposerFileProcessor' => $baseDir . '/rules/Composer/Application/FileProcessor/ComposerFileProcessor.php',
|
||||
'Rector\\Composer\\Contract\\Rector\\ComposerRectorInterface' => $baseDir . '/rules/Composer/Contract/Rector/ComposerRectorInterface.php',
|
||||
'Rector\\Composer\\Contract\\VersionAwareInterface' => $baseDir . '/rules/Composer/Contract/VersionAwareInterface.php',
|
||||
'Rector\\Composer\\Guard\\VersionGuard' => $baseDir . '/rules/Composer/Guard/VersionGuard.php',
|
||||
'Rector\\Composer\\Rector\\AddPackageToRequireComposerRector' => $baseDir . '/rules/Composer/Rector/AddPackageToRequireComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\AddPackageToRequireDevComposerRector' => $baseDir . '/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\ChangePackageVersionComposerRector' => $baseDir . '/rules/Composer/Rector/ChangePackageVersionComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\RemovePackageComposerRector' => $baseDir . '/rules/Composer/Rector/RemovePackageComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\RenamePackageComposerRector' => $baseDir . '/rules/Composer/Rector/RenamePackageComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\ReplacePackageAndVersionComposerRector' => $baseDir . '/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php',
|
||||
'Rector\\Composer\\ValueObject\\PackageAndVersion' => $baseDir . '/rules/Composer/ValueObject/PackageAndVersion.php',
|
||||
'Rector\\Composer\\ValueObject\\RenamePackage' => $baseDir . '/rules/Composer/ValueObject/RenamePackage.php',
|
||||
'Rector\\Composer\\ValueObject\\ReplacePackageAndVersion' => $baseDir . '/rules/Composer/ValueObject/ReplacePackageAndVersion.php',
|
||||
'Rector\\Config\\RectorConfig' => $baseDir . '/packages/Config/RectorConfig.php',
|
||||
'Rector\\Core\\Application\\ApplicationFileProcessor' => $baseDir . '/src/Application/ApplicationFileProcessor.php',
|
||||
'Rector\\Core\\Application\\ChangedNodeScopeRefresher' => $baseDir . '/src/Application/ChangedNodeScopeRefresher.php',
|
||||
@ -2391,8 +2378,6 @@ return array(
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\CallablePhpDocNodeVisitor' => $baseDir . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CallablePhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\CloningPhpDocNodeVisitor' => $baseDir . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\ParentConnectingPhpDocNodeVisitor' => $baseDir . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/ParentConnectingPhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\SimplePhpDocParser' => $baseDir . '/packages/PhpDocParser/PhpDocParser/SimplePhpDocParser.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\StaticFactory\\SimplePhpDocParserStaticFactory' => $baseDir . '/packages/PhpDocParser/PhpDocParser/StaticFactory/SimplePhpDocParserStaticFactory.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\ValueObject\\Ast\\PhpDoc\\SimplePhpDocNode' => $baseDir . '/packages/PhpDocParser/PhpDocParser/ValueObject/Ast/PhpDoc/SimplePhpDocNode.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\ValueObject\\PhpDocAttributeKey' => $baseDir . '/packages/PhpDocParser/PhpDocParser/ValueObject/PhpDocAttributeKey.php',
|
||||
'Rector\\PhpDocParser\\PhpParser\\SmartPhpParser' => $baseDir . '/packages/PhpDocParser/PhpParser/SmartPhpParser.php',
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b
|
||||
class ComposerAutoloaderInitf3134b9ed12cab2fbd4484930fa12946
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,19 +22,19 @@ class ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitf3134b9ed12cab2fbd4484930fa12946', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitf3134b9ed12cab2fbd4484930fa12946', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit564d0a066287c77fcf92d397fb539a4b::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInit564d0a066287c77fcf92d397fb539a4b::$files;
|
||||
$includeFiles = \Composer\Autoload\ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946::$files;
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequire564d0a066287c77fcf92d397fb539a4b($fileIdentifier, $file);
|
||||
composerRequiref3134b9ed12cab2fbd4484930fa12946($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
@ -46,7 +46,7 @@ class ComposerAutoloaderInit564d0a066287c77fcf92d397fb539a4b
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
function composerRequire564d0a066287c77fcf92d397fb539a4b($fileIdentifier, $file)
|
||||
function composerRequiref3134b9ed12cab2fbd4484930fa12946($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
23
vendor/composer/autoload_static.php
vendored
23
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit564d0a066287c77fcf92d397fb539a4b
|
||||
class ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946
|
||||
{
|
||||
public static $files = array (
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
@ -1653,19 +1653,6 @@ class ComposerStaticInit564d0a066287c77fcf92d397fb539a4b
|
||||
'Rector\\Compatibility\\NodeFactory\\ConstructorClassMethodFactory' => __DIR__ . '/../..' . '/rules/Compatibility/NodeFactory/ConstructorClassMethodFactory.php',
|
||||
'Rector\\Compatibility\\Rector\\Class_\\AttributeCompatibleAnnotationRector' => __DIR__ . '/../..' . '/rules/Compatibility/Rector/Class_/AttributeCompatibleAnnotationRector.php',
|
||||
'Rector\\Compatibility\\ValueObject\\PropertyWithPhpDocInfo' => __DIR__ . '/../..' . '/rules/Compatibility/ValueObject/PropertyWithPhpDocInfo.php',
|
||||
'Rector\\Composer\\Application\\FileProcessor\\ComposerFileProcessor' => __DIR__ . '/../..' . '/rules/Composer/Application/FileProcessor/ComposerFileProcessor.php',
|
||||
'Rector\\Composer\\Contract\\Rector\\ComposerRectorInterface' => __DIR__ . '/../..' . '/rules/Composer/Contract/Rector/ComposerRectorInterface.php',
|
||||
'Rector\\Composer\\Contract\\VersionAwareInterface' => __DIR__ . '/../..' . '/rules/Composer/Contract/VersionAwareInterface.php',
|
||||
'Rector\\Composer\\Guard\\VersionGuard' => __DIR__ . '/../..' . '/rules/Composer/Guard/VersionGuard.php',
|
||||
'Rector\\Composer\\Rector\\AddPackageToRequireComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/AddPackageToRequireComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\AddPackageToRequireDevComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/AddPackageToRequireDevComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\ChangePackageVersionComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/ChangePackageVersionComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\RemovePackageComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/RemovePackageComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\RenamePackageComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/RenamePackageComposerRector.php',
|
||||
'Rector\\Composer\\Rector\\ReplacePackageAndVersionComposerRector' => __DIR__ . '/../..' . '/rules/Composer/Rector/ReplacePackageAndVersionComposerRector.php',
|
||||
'Rector\\Composer\\ValueObject\\PackageAndVersion' => __DIR__ . '/../..' . '/rules/Composer/ValueObject/PackageAndVersion.php',
|
||||
'Rector\\Composer\\ValueObject\\RenamePackage' => __DIR__ . '/../..' . '/rules/Composer/ValueObject/RenamePackage.php',
|
||||
'Rector\\Composer\\ValueObject\\ReplacePackageAndVersion' => __DIR__ . '/../..' . '/rules/Composer/ValueObject/ReplacePackageAndVersion.php',
|
||||
'Rector\\Config\\RectorConfig' => __DIR__ . '/../..' . '/packages/Config/RectorConfig.php',
|
||||
'Rector\\Core\\Application\\ApplicationFileProcessor' => __DIR__ . '/../..' . '/src/Application/ApplicationFileProcessor.php',
|
||||
'Rector\\Core\\Application\\ChangedNodeScopeRefresher' => __DIR__ . '/../..' . '/src/Application/ChangedNodeScopeRefresher.php',
|
||||
@ -2671,8 +2658,6 @@ class ComposerStaticInit564d0a066287c77fcf92d397fb539a4b
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\CallablePhpDocNodeVisitor' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CallablePhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\CloningPhpDocNodeVisitor' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/CloningPhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\PhpDocNodeVisitor\\ParentConnectingPhpDocNodeVisitor' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/PhpDocNodeVisitor/ParentConnectingPhpDocNodeVisitor.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\SimplePhpDocParser' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/SimplePhpDocParser.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\StaticFactory\\SimplePhpDocParserStaticFactory' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/StaticFactory/SimplePhpDocParserStaticFactory.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\ValueObject\\Ast\\PhpDoc\\SimplePhpDocNode' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/ValueObject/Ast/PhpDoc/SimplePhpDocNode.php',
|
||||
'Rector\\PhpDocParser\\PhpDocParser\\ValueObject\\PhpDocAttributeKey' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpDocParser/ValueObject/PhpDocAttributeKey.php',
|
||||
'Rector\\PhpDocParser\\PhpParser\\SmartPhpParser' => __DIR__ . '/../..' . '/packages/PhpDocParser/PhpParser/SmartPhpParser.php',
|
||||
@ -3173,9 +3158,9 @@ class ComposerStaticInit564d0a066287c77fcf92d397fb539a4b
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit564d0a066287c77fcf92d397fb539a4b::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit564d0a066287c77fcf92d397fb539a4b::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit564d0a066287c77fcf92d397fb539a4b::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitf3134b9ed12cab2fbd4484930fa12946::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
3
vendor/scoper-autoload.php
vendored
3
vendor/scoper-autoload.php
vendored
@ -6,9 +6,6 @@ $loader = require_once __DIR__.'/autoload.php';
|
||||
|
||||
// Exposed classes. For more information see:
|
||||
// https://github.com/humbug/php-scoper/blob/master/docs/configuration.md#exposing-classes
|
||||
if (!class_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false) && !interface_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false) && !trait_exists('Symplify\ComposerJsonManipulator\ValueObject\ComposerJson', false)) {
|
||||
spl_autoload_call('RectorPrefix202208\Symplify\ComposerJsonManipulator\ValueObject\ComposerJson');
|
||||
}
|
||||
if (!class_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !interface_exists('Symplify\SmartFileSystem\SmartFileInfo', false) && !trait_exists('Symplify\SmartFileSystem\SmartFileInfo', false)) {
|
||||
spl_autoload_call('RectorPrefix202208\Symplify\SmartFileSystem\SmartFileInfo');
|
||||
}
|
||||
|
@ -729,8 +729,3 @@ final class ComposerJson
|
||||
return \array_search($key, $items, \true);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @api
|
||||
* @see \Symplify\ComposerJsonManipulator\Tests\ValueObject\ComposerJsonTest
|
||||
*/
|
||||
\class_alias('RectorPrefix202208\\Symplify\\ComposerJsonManipulator\\ValueObject\\ComposerJson', 'Symplify\\ComposerJsonManipulator\\ValueObject\\ComposerJson', \false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user