mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-16 21:08:19 +01:00
Updated Rector to commit efc969e6411704d02e004045cb8b1da5d263970c
efc969e641
Improve setup-ci command with helper links and allow override (#3438)
This commit is contained in:
parent
0e8b799327
commit
867e9441ef
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'a7d45e469a134f8671749aaf4a9a5ea797394e3a';
|
||||
public const PACKAGE_VERSION = 'efc969e6411704d02e004045cb8b1da5d263970c';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-03-02 12:21:07';
|
||||
public const RELEASE_DATE = '2023-03-02 15:22:13';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -41,22 +41,35 @@ final class SetupCICommand extends Command
|
||||
$this->symfonyStyle->error('No CI detected');
|
||||
return self::FAILURE;
|
||||
}
|
||||
if ($ci === CiDetector::CI_GITHUB_ACTIONS) {
|
||||
$rectorWorkflowFilePath = \getcwd() . '/.github/workflows/rector.yaml';
|
||||
if (\file_exists($rectorWorkflowFilePath)) {
|
||||
$this->symfonyStyle->warning('The "rector.yaml" workflow already exists');
|
||||
if ($ci !== CiDetector::CI_GITHUB_ACTIONS) {
|
||||
$noteMessage = \sprintf('Only Github Action is supported for now.%sCreate an issue to add your CI %s', \PHP_EOL, 'https://github.com/rectorphp/rector/issues/');
|
||||
$this->symfonyStyle->note($noteMessage);
|
||||
return self::SUCCESS;
|
||||
}
|
||||
$rectorWorkflowFilePath = \getcwd() . '/.github/workflows/rector.yaml';
|
||||
if (\file_exists($rectorWorkflowFilePath)) {
|
||||
$response = $this->symfonyStyle->ask('The "rector.yaml" workflow already exists. Overwrite it?', 'Yes');
|
||||
if (!\in_array($response, ['y', 'yes', 'Yes'], \true)) {
|
||||
$this->symfonyStyle->note('Nothing changed');
|
||||
return self::SUCCESS;
|
||||
}
|
||||
$currentRepository = $this->resolveCurrentRepositoryName(\getcwd());
|
||||
if ($currentRepository === null) {
|
||||
$this->symfonyStyle->error('Current repository name could not be resolved');
|
||||
return self::FAILURE;
|
||||
}
|
||||
$workflowTemplate = FileSystem::read(__DIR__ . '/../../../templates/rector-github-action-check.yaml');
|
||||
$workflowContents = \strtr($workflowTemplate, ['__CURRENT_REPOSITORY__' => $currentRepository]);
|
||||
FileSystem::write($rectorWorkflowFilePath, $workflowContents);
|
||||
$this->symfonyStyle->success('The "rector.yaml" workflow was added');
|
||||
}
|
||||
$currentRepository = $this->resolveCurrentRepositoryName(\getcwd());
|
||||
if ($currentRepository === null) {
|
||||
$this->symfonyStyle->error('Current repository name could not be resolved');
|
||||
return self::FAILURE;
|
||||
}
|
||||
$workflowTemplate = FileSystem::read(__DIR__ . '/../../../templates/rector-github-action-check.yaml');
|
||||
$workflowContents = \strtr($workflowTemplate, ['__CURRENT_REPOSITORY__' => $currentRepository]);
|
||||
FileSystem::write($rectorWorkflowFilePath, $workflowContents);
|
||||
$this->symfonyStyle->newLine();
|
||||
$this->symfonyStyle->note('The "rector.yaml" workflow was added');
|
||||
$this->symfonyStyle->newLine();
|
||||
$this->symfonyStyle->title('2 steps more to run you Github Action:');
|
||||
$this->symfonyStyle->writeln('1) Generate new Github Token here:' . \PHP_EOL . 'https://github.com/settings/tokens/new');
|
||||
$this->symfonyStyle->newLine();
|
||||
$this->symfonyStyle->writeln('2) Add it to your repository secrets under "GITHUB_TOKE" name:' . \PHP_EOL . \sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository));
|
||||
$this->symfonyStyle->newLine();
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
/**
|
||||
|
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 ComposerAutoloaderInite4770c262ed48ac8d5798b18be9cb769::getLoader();
|
||||
return ComposerAutoloaderInit9823ecb4d7a2d3b55a3976916fa0bfb2::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 ComposerAutoloaderInite4770c262ed48ac8d5798b18be9cb769
|
||||
class ComposerAutoloaderInit9823ecb4d7a2d3b55a3976916fa0bfb2
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -22,17 +22,17 @@ class ComposerAutoloaderInite4770c262ed48ac8d5798b18be9cb769
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInite4770c262ed48ac8d5798b18be9cb769', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInit9823ecb4d7a2d3b55a3976916fa0bfb2', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInite4770c262ed48ac8d5798b18be9cb769', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit9823ecb4d7a2d3b55a3976916fa0bfb2', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInite4770c262ed48ac8d5798b18be9cb769::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2::getInitializer($loader));
|
||||
|
||||
$loader->setClassMapAuthoritative(true);
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInite4770c262ed48ac8d5798b18be9cb769::$files;
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2::$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 ComposerStaticInite4770c262ed48ac8d5798b18be9cb769
|
||||
class ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
@ -3148,9 +3148,9 @@ class ComposerStaticInite4770c262ed48ac8d5798b18be9cb769
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInite4770c262ed48ac8d5798b18be9cb769::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInite4770c262ed48ac8d5798b18be9cb769::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInite4770c262ed48ac8d5798b18be9cb769::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit9823ecb4d7a2d3b55a3976916fa0bfb2::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user