Skip to content

Commit

Permalink
Updated Rector to commit 60c06a7
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Nov 20, 2021
1 parent b522cb4 commit cd31960
Show file tree
Hide file tree
Showing 1,822 changed files with 15,465 additions and 11,118 deletions.
42 changes: 21 additions & 21 deletions bin/generate-changelog.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use RectorPrefix20211119\Httpful\Request;
use RectorPrefix20211119\Nette\Utils\Strings;
use RectorPrefix20211119\Symfony\Component\Console\Application;
use RectorPrefix20211119\Symfony\Component\Console\Command\Command;
use RectorPrefix20211119\Symfony\Component\Console\Input\InputArgument;
use RectorPrefix20211119\Symfony\Component\Console\Input\InputInterface;
use RectorPrefix20211119\Symfony\Component\Console\Output\OutputInterface;
use RectorPrefix20211119\Symfony\Component\Process\Process;
use RectorPrefix20211119\Symplify\PackageBuilder\Console\Command\CommandNaming;
use RectorPrefix20211120\Httpful\Request;
use RectorPrefix20211120\Nette\Utils\Strings;
use RectorPrefix20211120\Symfony\Component\Console\Application;
use RectorPrefix20211120\Symfony\Component\Console\Command\Command;
use RectorPrefix20211120\Symfony\Component\Console\Input\InputArgument;
use RectorPrefix20211120\Symfony\Component\Console\Input\InputInterface;
use RectorPrefix20211120\Symfony\Component\Console\Output\OutputInterface;
use RectorPrefix20211120\Symfony\Component\Process\Process;
use RectorPrefix20211120\Symplify\PackageBuilder\Console\Command\CommandNaming;
require __DIR__ . '/../vendor/autoload.php';
/**
* Inspired from @see https://github.com/phpstan/phpstan-src/blob/master/bin/generate-changelog.php
Expand All @@ -20,7 +20,7 @@
* GITHUB_TOKEN=<github_token> php bin/generate-changelog.php <from-commit> <to-commit> >> <file_to_dump.md>
* GITHUB_TOKEN=ghp_... php bin/generate-changelog.php 07736c1 cb74bb6 >> CHANGELOG_dumped.md
*/
final class GenerateChangelogCommand extends \RectorPrefix20211119\Symfony\Component\Console\Command\Command
final class GenerateChangelogCommand extends \RectorPrefix20211120\Symfony\Component\Console\Command\Command
{
/**
* @var string
Expand Down Expand Up @@ -48,9 +48,9 @@ final class GenerateChangelogCommand extends \RectorPrefix20211119\Symfony\Compo
private const HASH = 'hash';
protected function configure() : void
{
$this->setName(\RectorPrefix20211119\Symplify\PackageBuilder\Console\Command\CommandNaming::classToName(self::class));
$this->addArgument(self::OPTION_FROM_COMMIT, \RectorPrefix20211119\Symfony\Component\Console\Input\InputArgument::REQUIRED);
$this->addArgument(self::OPTION_TO_COMMIT, \RectorPrefix20211119\Symfony\Component\Console\Input\InputArgument::REQUIRED);
$this->setName(\RectorPrefix20211120\Symplify\PackageBuilder\Console\Command\CommandNaming::classToName(self::class));
$this->addArgument(self::OPTION_FROM_COMMIT, \RectorPrefix20211120\Symfony\Component\Console\Input\InputArgument::REQUIRED);
$this->addArgument(self::OPTION_TO_COMMIT, \RectorPrefix20211120\Symfony\Component\Console\Input\InputArgument::REQUIRED);
}
/**
* @param \Symfony\Component\Console\Input\InputInterface $input
Expand All @@ -68,14 +68,14 @@ protected function execute($input, $output) : int
$i = 0;
foreach ($commits as $commit) {
$searchPullRequestsUri = \sprintf('https://api.github.com/search/issues?q=repo:' . self::DEVELOPMENT_REPOSITORY_NAME . '+%s', $commit[self::HASH]);
$searchPullRequestsResponse = \RectorPrefix20211119\Httpful\Request::get($searchPullRequestsUri)->sendsAndExpectsType('application/json')->basicAuth('tomasvotruba', \getenv('GITHUB_TOKEN'))->send();
$searchPullRequestsResponse = \RectorPrefix20211120\Httpful\Request::get($searchPullRequestsUri)->sendsAndExpectsType('application/json')->basicAuth('tomasvotruba', \getenv('GITHUB_TOKEN'))->send();
if ($searchPullRequestsResponse->code !== 200) {
$output->writeln(\var_export($searchPullRequestsResponse->body, \true));
throw new \InvalidArgumentException((string) $searchPullRequestsResponse->code);
}
$searchPullRequestsResponse = $searchPullRequestsResponse->body;
$searchIssuesUri = \sprintf('https://api.github.com/search/issues?q=repo:' . self::DEPLOY_REPOSITORY_NAME . '+%s', $commit[self::HASH]);
$searchIssuesResponse = \RectorPrefix20211119\Httpful\Request::get($searchIssuesUri)->sendsAndExpectsType('application/json')->basicAuth('tomasvotruba', \getenv('GITHUB_TOKEN'))->send();
$searchIssuesResponse = \RectorPrefix20211120\Httpful\Request::get($searchIssuesUri)->sendsAndExpectsType('application/json')->basicAuth('tomasvotruba', \getenv('GITHUB_TOKEN'))->send();
if ($searchIssuesResponse->code !== 200) {
$output->writeln(\var_export($searchIssuesResponse->body, \true));
throw new \InvalidArgumentException((string) $searchIssuesResponse->code);
Expand All @@ -94,7 +94,7 @@ protected function execute($input, $output) : int
}
}
// clean commit from duplicating issue number
$commitMatch = \RectorPrefix20211119\Nette\Utils\Strings::match($commit['message'], '#(.*?)( \\(\\#\\d+\\))?$#ms');
$commitMatch = \RectorPrefix20211120\Nette\Utils\Strings::match($commit['message'], '#(.*?)( \\(\\#\\d+\\))?$#ms');
$commit = $commitMatch[1] ?? $commit['message'];
$changelogLine = \sprintf('* %s (%s)%s%s', $commit, $parenthesis, $issuesToReference !== [] ? ', ' . \implode(', ', $issuesToReference) : '', $this->createThanks($thanks));
$output->writeln($changelogLine);
Expand Down Expand Up @@ -124,7 +124,7 @@ protected function createThanks($thanks) : string
*/
private function exec(array $commandParts) : string
{
$process = new \RectorPrefix20211119\Symfony\Component\Process\Process($commandParts);
$process = new \RectorPrefix20211120\Symfony\Component\Process\Process($commandParts);
$process->run();
return $process->getOutput();
}
Expand All @@ -148,8 +148,8 @@ private function resolveCommitLinesFromToHashes(string $fromCommit, string $toCo
* GITHUB_TOKEN=ghp_... php bin/generate-changelog.php 07736c1 cb74bb6 >> CHANGELOG_dumped.md
*/
\class_alias('GenerateChangelogCommand', 'GenerateChangelogCommand', \false);
$generateChangelogCommand = new \RectorPrefix20211119\GenerateChangelogCommand();
$application = new \RectorPrefix20211119\Symfony\Component\Console\Application();
$generateChangelogCommand = new \RectorPrefix20211120\GenerateChangelogCommand();
$application = new \RectorPrefix20211120\Symfony\Component\Console\Application();
$application->add($generateChangelogCommand);
$application->setDefaultCommand(\RectorPrefix20211119\Symplify\PackageBuilder\Console\Command\CommandNaming::classToName(\get_class($generateChangelogCommand)), \true);
$application->setDefaultCommand(\RectorPrefix20211120\Symplify\PackageBuilder\Console\Command\CommandNaming::classToName(\get_class($generateChangelogCommand)), \true);
$application->run();
2 changes: 1 addition & 1 deletion bin/rector
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env php
<?php
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

require_once __DIR__ . '/rector.php';
22 changes: 11 additions & 11 deletions bin/rector.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use RectorPrefix20211119\Nette\Utils\Json;
use RectorPrefix20211120\Nette\Utils\Json;
use Rector\ChangesReporting\Output\JsonOutputFormatter;
use Rector\Core\Bootstrap\RectorConfigsResolver;
use Rector\Core\Configuration\Option;
use Rector\Core\Console\ConsoleApplication;
use Rector\Core\Console\Style\SymfonyStyleFactory;
use Rector\Core\DependencyInjection\RectorContainerFactory;
use Rector\Core\Kernel\RectorKernel;
use RectorPrefix20211119\Symfony\Component\Console\Command\Command;
use RectorPrefix20211119\Symfony\Component\Console\Input\ArgvInput;
use RectorPrefix20211119\Symplify\PackageBuilder\Reflection\PrivatesCaller;
use RectorPrefix20211120\Symfony\Component\Console\Command\Command;
use RectorPrefix20211120\Symfony\Component\Console\Input\ArgvInput;
use RectorPrefix20211120\Symplify\PackageBuilder\Reflection\PrivatesCaller;
// @ intentionally: continue anyway
@\ini_set('memory_limit', '-1');
// Performance boost
Expand All @@ -22,7 +22,7 @@
\gc_disable();
\define('__RECTOR_RUNNING__', \true);
// Require Composer autoload.php
$autoloadIncluder = new \RectorPrefix20211119\AutoloadIncluder();
$autoloadIncluder = new \RectorPrefix20211120\AutoloadIncluder();
$autoloadIncluder->includeDependencyOrRepositoryVendorAutoloadIfExists();
if (\file_exists(__DIR__ . '/../preload.php') && \is_dir(__DIR__ . '/../vendor')) {
require_once __DIR__ . '/../preload.php';
Expand All @@ -38,18 +38,18 @@
$container = $rectorContainerFactory->createFromBootstrapConfigs($bootstrapConfigs);
} catch (\Throwable $throwable) {
// for json output
$argvInput = new \RectorPrefix20211119\Symfony\Component\Console\Input\ArgvInput();
$argvInput = new \RectorPrefix20211120\Symfony\Component\Console\Input\ArgvInput();
$outputFormat = $argvInput->getParameterOption('--' . \Rector\Core\Configuration\Option::OUTPUT_FORMAT);
// report fatal error in json format
if ($outputFormat === \Rector\ChangesReporting\Output\JsonOutputFormatter::NAME) {
echo \RectorPrefix20211119\Nette\Utils\Json::encode(['fatal_errors' => [$throwable->getMessage()]]);
echo \RectorPrefix20211120\Nette\Utils\Json::encode(['fatal_errors' => [$throwable->getMessage()]]);
} else {
// report fatal errors in console format
$symfonyStyleFactory = new \Rector\Core\Console\Style\SymfonyStyleFactory(new \RectorPrefix20211119\Symplify\PackageBuilder\Reflection\PrivatesCaller());
$symfonyStyleFactory = new \Rector\Core\Console\Style\SymfonyStyleFactory(new \RectorPrefix20211120\Symplify\PackageBuilder\Reflection\PrivatesCaller());
$symfonyStyle = $symfonyStyleFactory->create();
$symfonyStyle->error($throwable->getMessage());
}
exit(\RectorPrefix20211119\Symfony\Component\Console\Command\Command::FAILURE);
exit(\RectorPrefix20211120\Symfony\Component\Console\Command\Command::FAILURE);
}
/** @var ConsoleApplication $application */
$application = $container->get(\Rector\Core\Console\ConsoleApplication::class);
Expand Down Expand Up @@ -103,4 +103,4 @@ public function loadIfExistsAndNotLoadedYet(string $filePath) : void
require_once $filePath;
}
}
\class_alias('RectorPrefix20211119\\AutoloadIncluder', 'AutoloadIncluder', \false);
\class_alias('RectorPrefix20211120\\AutoloadIncluder', 'AutoloadIncluder', \false);
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use Rector\Core\Bootstrap\ExtensionConfigResolver;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
Expand Down
2 changes: 1 addition & 1 deletion config/parameters.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use Rector\Caching\ValueObject\Storage\MemoryCacheStorage;
use Rector\Core\Configuration\Option;
Expand Down
2 changes: 1 addition & 1 deletion config/services-packages.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator) : void {
Expand Down
2 changes: 1 addition & 1 deletion config/services-rules.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

declare (strict_types=1);
namespace RectorPrefix20211119;
namespace RectorPrefix20211120;

use Rector\Core\Configuration\Option;
use Rector\PSR4\Composer\PSR4NamespaceMatcher;
Expand Down

0 comments on commit cd31960

Please sign in to comment.