Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03930d3

Browse filesBrowse files
Merge branch '6.2' into 6.3
* 6.2: [HttpKernel] fix merge [HttpKernel] fix merge Revert "bug #48089 [Console] Fix clear line with question in section (maxbeckers)" [Cache] fix lazyness of redis when using RedisTagAwareAdapter
2 parents e7482d7 + 1836270 commit 03930d3
Copy full SHA for 03930d3

File tree

7 files changed

+17
-58
lines changed
Filter options

7 files changed

+17
-58
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ class WebProfilerExtensionTest extends TestCase
3838

3939
public static function assertSaneContainer(Container $container)
4040
{
41+
$removedIds = $container->getRemovedIds();
4142
$errors = [];
4243
foreach ($container->getServiceIds() as $id) {
44+
if (isset($removedIds[$id])) {
45+
continue;
46+
}
4347
try {
4448
$container->get($id);
4549
} catch (\Exception $e) {

‎src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Adapter/RedisTagAwareAdapter.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __construct(\Redis|\RedisArray|\RedisCluster|\Predis\ClientInter
6565
throw new InvalidArgumentException(sprintf('Unsupported Predis cluster connection: only "%s" is, "%s" given.', PredisCluster::class, get_debug_type($redis->getConnection())));
6666
}
6767

68-
if (\defined('Redis::OPT_COMPRESSION') && ($redis instanceof \Redis || $redis instanceof \RedisArray || $redis instanceof \RedisCluster)) {
68+
if (\defined('Redis::OPT_COMPRESSION') && \in_array($redis::class, [\Redis::class, \RedisArray::class, \RedisCluster::class], true)) {
6969
$compression = $redis->getOption(\Redis::OPT_COMPRESSION);
7070

7171
foreach (\is_array($compression) ? $compression : [$compression] as $c) {

‎src/Symfony/Component/Console/Output/ConsoleSectionOutput.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Output/ConsoleSectionOutput.php
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,6 @@ public function getVisibleContent(): string
102102
return implode('', \array_slice($this->content, -$this->maxHeight));
103103
}
104104

105-
/**
106-
* @internal
107-
*/
108-
public function incrementLines()
109-
{
110-
++$this->lines;
111-
}
112-
113105
/**
114106
* @internal
115107
*/

‎src/Symfony/Component/Console/Style/SymfonyStyle.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Style/SymfonyStyle.php
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Symfony\Component\Console\Helper\TableSeparator;
2424
use Symfony\Component\Console\Input\InputInterface;
2525
use Symfony\Component\Console\Output\ConsoleOutputInterface;
26-
use Symfony\Component\Console\Output\ConsoleSectionOutput;
2726
use Symfony\Component\Console\Output\OutputInterface;
2827
use Symfony\Component\Console\Output\TrimmedBufferOutput;
2928
use Symfony\Component\Console\Question\ChoiceQuestion;
@@ -301,11 +300,6 @@ public function askQuestion(Question $question): mixed
301300
if ($this->input->isInteractive()) {
302301
$this->newLine();
303302
$this->bufferedOutput->write("\n");
304-
if ($this->output instanceof ConsoleSectionOutput) {
305-
// add one line more to the ConsoleSectionOutput because of the `return` to submit the input
306-
// this is relevant when a `ConsoleSectionOutput::clear` is called.
307-
$this->output->incrementLines();
308-
}
309303
}
310304

311305
return $answer;

‎src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php
-36Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
use Symfony\Component\Console\Exception\RuntimeException;
1717
use Symfony\Component\Console\Formatter\OutputFormatter;
1818
use Symfony\Component\Console\Input\ArrayInput;
19-
use Symfony\Component\Console\Input\Input;
2019
use Symfony\Component\Console\Input\InputInterface;
2120
use Symfony\Component\Console\Output\ConsoleOutputInterface;
2221
use Symfony\Component\Console\Output\ConsoleSectionOutput;
2322
use Symfony\Component\Console\Output\NullOutput;
2423
use Symfony\Component\Console\Output\OutputInterface;
25-
use Symfony\Component\Console\Output\StreamOutput;
2624
use Symfony\Component\Console\Style\SymfonyStyle;
2725
use Symfony\Component\Console\Tester\CommandTester;
2826

@@ -183,38 +181,4 @@ public function testMemoryConsumption()
183181

184182
$this->assertSame(0, memory_get_usage() - $start);
185183
}
186-
187-
public function testAskAndClearExpectFullSectionCleared()
188-
{
189-
$answer = 'Answer';
190-
$inputStream = fopen('php://memory', 'r+');
191-
fwrite($inputStream, $answer.\PHP_EOL);
192-
rewind($inputStream);
193-
$input = $this->createMock(Input::class);
194-
$sections = [];
195-
$output = new ConsoleSectionOutput(fopen('php://memory', 'r+', false), $sections, StreamOutput::VERBOSITY_NORMAL, true, new OutputFormatter());
196-
$input
197-
->method('isInteractive')
198-
->willReturn(true);
199-
$input
200-
->method('getStream')
201-
->willReturn($inputStream);
202-
203-
$style = new SymfonyStyle($input, $output);
204-
205-
$style->write('foo');
206-
$givenAnswer = $style->ask('Dummy question?');
207-
$output->write('bar');
208-
$output->clear();
209-
210-
rewind($output->getStream());
211-
$this->assertEquals($answer, $givenAnswer);
212-
$this->assertEquals(
213-
'foo'.\PHP_EOL. // write foo
214-
\PHP_EOL.\PHP_EOL.\PHP_EOL." \033[32mDummy question?\033[39m:".\PHP_EOL.' > '.\PHP_EOL.\PHP_EOL.\PHP_EOL. // question
215-
'bar'.\PHP_EOL. // write bar
216-
"\033[10A\033[0J", // clear 10 lines (9 output lines and one from the answer input return)
217-
stream_get_contents($output->getStream())
218-
);
219-
}
220184
}

‎src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function testAutowireAttribute()
467467
$container = new ContainerBuilder();
468468
$resolver = $container->register('argument_resolver.service', 'stdClass')->addArgument([]);
469469

470-
$container->register('some.id', \stdClass::class);
470+
$container->register('some.id', \stdClass::class)->setPublic(true);
471471
$container->setParameter('some.parameter', 'foo');
472472

473473
$container->register('foo', WithAutowireAttribute::class)

‎src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/EventListener/SessionListenerTest.php
+11-6Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -558,22 +558,27 @@ public function testUninitializedSessionWithoutInitializedSession()
558558
public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarted()
559559
{
560560
$session = $this->createMock(Session::class);
561-
$session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1));
561+
$session->expects($this->once())->method('getUsageIndex')->willReturn(1);
562+
$session->expects($this->once())->method('getName')->willReturn('foo');
563+
$sessionFactory = $this->createMock(SessionFactory::class);
564+
$sessionFactory->expects($this->once())->method('createSession')->willReturn($session);
562565

563566
$container = new Container();
564-
$container->set('initialized_session', $session);
567+
$container->set('session_factory', $sessionFactory);
565568

566569
$listener = new SessionListener($container);
567570
$kernel = $this->createMock(HttpKernelInterface::class);
568571

569572
$request = new Request();
570573
$listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST));
571574

575+
$request->getSession();
576+
572577
$response = new Response();
573578
$response->setPrivate();
574579
$expiresHeader = gmdate('D, d M Y H:i:s', time() + 600).' GMT';
575580
$response->setMaxAge(600);
576-
$listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response));
581+
$listener->onKernelResponse(new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response));
577582

578583
$this->assertTrue($response->headers->has('expires'));
579584
$this->assertSame($expiresHeader, $response->headers->get('expires'));
@@ -588,20 +593,20 @@ public function testResponseHeadersMaxAgeAndExpiresNotBeOverridenIfSessionStarte
588593
public function testResponseHeadersMaxAgeAndExpiresDefaultValuesIfSessionStarted()
589594
{
590595
$session = $this->createMock(Session::class);
591-
$session->expects($this->exactly(2))->method('getUsageIndex')->will($this->onConsecutiveCalls(0, 1));
596+
$session->expects($this->once())->method('getUsageIndex')->willReturn(1);
592597

593598
$container = new Container();
594-
$container->set('initialized_session', $session);
595599

596600
$listener = new SessionListener($container);
597601
$kernel = $this->createMock(HttpKernelInterface::class);
598602

599603
$request = new Request();
604+
$request->setSession($session);
600605
$listener->onKernelRequest(new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST));
601606

602607
$response = new Response();
603608
$expiresHeader = gmdate('D, d M Y H:i:s', time()).' GMT';
604-
$listener->onKernelResponse(new ResponseEvent($kernel, new Request(), HttpKernelInterface::MAIN_REQUEST, $response));
609+
$listener->onKernelResponse(new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response));
605610

606611
$this->assertTrue($response->headers->has('expires'));
607612
$this->assertSame($expiresHeader, $response->headers->get('expires'));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.