Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle][Yaml] Remove some unused code #49290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2396,10 +2396,6 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder

private function registerRetryableHttpClient(array $options, string $name, ContainerBuilder $container)
{
if (!class_exists(RetryableHttpClient::class)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony/framework-bundle conflicts with symfony/http-client < 5.4`

throw new LogicException('Support for retrying failed requests requires symfony/http-client 5.2 or higher, try upgrading.');
}

if (null !== $options['retry_strategy']) {
$retryStrategy = new Reference($options['retry_strategy']);
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/Yaml/Command/LintCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->format = $input->getOption('format');
$flags = $input->getOption('parse-tags');

if ('github' === $this->format && !class_exists(GithubActionReporter::class)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony/yaml conflicts with symfony/console < 5.4

throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.');
}

if (null === $this->format) {
// Autodetect format according to CI environment
$this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt';
Expand Down
10 changes: 0 additions & 10 deletions src/Symfony/Component/Yaml/Tests/Command/LintCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\CI\GithubActionReporter;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\CommandCompletionTester;
Expand Down Expand Up @@ -68,11 +67,6 @@ public function testLintIncorrectFile()

public function testLintIncorrectFileWithGithubFormat()
{
if (!class_exists(GithubActionReporter::class)) {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The "github" format is only available since "symfony/console" >= 5.3.');
}

$incorrectContent = <<<YAML
foo:
bar
Expand All @@ -82,10 +76,6 @@ public function testLintIncorrectFileWithGithubFormat()

$tester->execute(['filename' => $filename, '--format' => 'github'], ['decorated' => false]);

if (!class_exists(GithubActionReporter::class)) {
return;
}

self::assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
self::assertStringMatchesFormat('%A::error file=%s,line=2,col=0::Unable to parse at line 2 (near "bar")%A', trim($tester->getDisplay()));
}
Expand Down