Skip to content

Commit e735fe6

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: (23 commits) fix tests using Twig 3.12 skip tests requiring the intl extension if it's not installed 🐛 throw ParseException on invalid date fix permitted data type of the default choice [ExpressionLanguage] Improve test coverage Fix invalid phpdoc in ContainerBuilder [HttpKernel] [WebProfileBundle] Fix Routing panel for URLs with a colon [Form] NumberType: Fix parsing of numbers in exponential notation with negative exponent [Security] consistent singular/plural translation in Dutch reset the validation context after validating nested constraints do not duplicate directory separators fix handling empty data in ValueToDuplicatesTransformer fix compatibility with redis extension 6.0.3+ synchronize unsupported scheme tests [String] Fixed Quorum plural, that was inflected to be only "Quora" and never "Quorums" Fix symfony/kaz-info-teh-notifier package [Validator] review latvian translations [Validator] Add Dutch translation for `WordCount` constraint allow more unicode characters in URL paths [String][EnglishInflector] Fix words ending in 'le', e.g., articles ...
2 parents 26a00b8 + 3fe8926 commit e735fe6

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

RawMessage.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class RawMessage
2121
private bool $isGeneratorClosed;
2222

2323
/**
24-
* @param iterable|string|resource $message
24+
* @param iterable<string>|string|resource $message
2525
*/
2626
public function __construct(
27-
private $message,
27+
private mixed $message,
2828
) {
2929
}
3030

Tests/RawMessageTest.php

+19
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,25 @@ public function testToIterableLegacy(mixed $messageParameter, bool $supportReuse
7575
}
7676
}
7777

78+
public function testToIterableOnResourceRewindsAndYieldsLines()
79+
{
80+
$handle = \fopen('php://memory', 'r+');
81+
\fwrite($handle, "line1\nline2\nline3\n");
82+
83+
$message = new RawMessage($handle);
84+
$this->assertSame("line1\nline2\nline3\n", implode('', iterator_to_array($message->toIterable())));
85+
}
86+
87+
public function testDestructClosesResource()
88+
{
89+
$handle = fopen('php://memory', 'r+');
90+
91+
$message = new RawMessage($handle);
92+
unset($message);
93+
94+
$this->assertIsClosedResource($handle);
95+
}
96+
7897
public static function provideMessages(): array
7998
{
8099
return [

0 commit comments

Comments
 (0)