8000 Merge branch '4.4' into 5.0 · symfony/symfony@572117a · GitHub
[go: up one dir, main page]

Skip to content

Commit 572117a

Browse files
Merge branch '4.4' into 5.0
* 4.4: Fix failures on PHP 7.4 Fix tests [Console] fix typos [Console] fix tests
2 parents 32b5d07 + febff9b commit 572117a

File tree

7 files changed

+16
-13
lines changed

7 files changed

+16
-13
lines changed

src/Symfony/Component/Config/Resource/ClassExistenceResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function isFresh(int $timestamp): bool
7272
spl_autoload_register(__CLASS__.'::throwOnRequiredClass');
7373
}
7474
$autoloadedClass = self::$autoloadedClass;
75-
self::$autoloadedClass = $this->resource;
75+
self::$autoloadedClass = ltrim($this->resource, '\\');
7676

7777
try {
7878
$exists = class_exists($this->resource) || interface_exists($this->resource, false) || trait_exists($this->resource, false);
@@ -153,7 +153,7 @@ public static function throwOnRequiredClass(string $class, \Exception $previous
153153
throw $e;
154154
}
155155

156-
$trace = $e->getTrace();
156+
$trace = debug_backtrace();
157157
$autoloadFrame = [
158158
'function' => 'spl_autoload_call',
159159
'args' => [$class],

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
230230
} elseif ("\177" === $c) { // Backspace Character
231231
if (0 === $numMatches && 0 !== $i) {
232232
--$i;
233-
$fullChoice = self::substr($fullChoice, 0, -1);
233+
$fullChoice = self::substr($fullChoice, 0, $i);
234234
// Move cursor backwards
235235
$output->write("\033[1D");
236236
}
@@ -286,6 +286,8 @@ function ($match) use ($ret) {
286286
$output->write($c);
287287
break;
288288
}
289+
290+
$numMatches = 0;
289291
}
290292

291293
continue;

src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public function testAskWithAutocomplete()
194194
// <DOWN ARROW><NEWLINE>
195195
// S<BACKSPACE><BACKSPACE><DOWN ARROW><DOWN ARROW><NEWLINE>
196196
// F00<BACKSPACE><BACKSPACE>oo<TAB><NEWLINE>
197-
// F⭐<TAB><BACKSPACE><BACKSPACE>⭐<TAB><NEWLINE>
197+
// F⭐<TAB><BACKSPACE><BACKSPACE>⭐<TAB><NEWLINE>
198198
$inputStream = $this->getInputStream("Acm\nAc\177\177s\tTest\n\n\033[A\033[A\033[A\n\033[A\033[A\033[A\033[A\033[A\033[A\033[A\tTest\n\033[B\nS\177\177\033[B\033[B\nF00\177\177oo\t\nF⭐\t\177\177\t\n");
199199

200200
$dialog = new QuestionHelper();
@@ -774,7 +774,7 @@ public function testTraversableMultiselectAutocomplete()
774774
// F00<BACKSPACE><BACKSPACE>o<TAB>,A<DOWN ARROW>,<SPACE>SecurityBundle<NEWLINE>
775775
// Acme<TAB>,<SPACE>As<TAB><29x BACKSPACE>S<TAB><NEWLINE>
776776
// Ac<TAB>,As<TAB><3x BACKSPACE>d<TAB><NEWLINE>
777-
$inputStream = $this->getInputStream("\nF\t\nA\033[A\033[A\033[A\t,F\t\nF00\177\177o\t,A\033[B\t, SecurityBundle\nSecurityBundle\nAcme\t, As\t\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177S\t\nAc\t,As\t\177\177\177d\t\n");
777+
$inputStream = $this->getInputStream("\nF\t\nA\033[A\033[A\033[A\t,F\t\nF00\177\177o\t,A\033[B\t, SecurityBundle\nAcme\t, As\t\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177\177S\t\nAc\t,As\t\177\177\177d\t\n");
778778

779779
$dialog = new QuestionHelper();
780780
$helperSet = new HelperSet([new FormatterHelper()]);

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_bindings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
bind:
1313
Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface: '@Symfony\Component\DependencyInjection\Tests\Fixtures\Bar'
1414
$foo: [ ~ ]
15-
iterable $baz: !tagged_iterator bar
15+
iterable $baz: !tagged_iterator { tag: bar }
1616

1717
Symfony\Component\DependencyInjection\Tests\Fixtures\Bar:
1818
factory: [ ~, 'create' ]

src/Symfony/Component/Messenger/Tests/Command/FailedMessagesShowCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testReceiverShouldBeListable()
113113
public function testListMessages()
114114
{
115115
$sentToFailureStamp = new SentToFailureTransportStamp('async');
116-
$redeliveryStamp = new RedeliveryStamp(0, 'failure_receiver', 'Things are bad!');
116+
$redeliveryStamp = new RedeliveryStamp(0, 'Things are bad!');
117117
$envelope = new Envelope(new \stdClass(), [
118118
new TransportMessageIdStamp(15),
119119
$sentToFailureStamp,
@@ -158,7 +158,7 @@ public function testListMessagesReturnsPaginatedMessages()
158158
$envelope = new Envelope(new \stdClass(), [
159159
new TransportMessageIdStamp(15),
160160
$sentToFailureStamp,
161-
new RedeliveryStamp(0, 'failure_receiver', 'Things are bad!'),
161+
new RedeliveryStamp(0, 'Things are bad!'),
162162
]);
163163
$receiver = $this->createMock(ListableReceiverInterface::class);
164164
$receiver->expects($this->once())->method('all')->with()->willReturn([$envelope]);

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@ private static function throwInvalidArgumentException(string $message, array $tr
188188
return;
189189
}
190190

191-
if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file'] && \array_key_exists(0, $trace[$i]['args'])) {
191+
if (isset($trace[$i]['file']) && __FILE__ === $trace[$i]['file']) {
192192
$pos = strpos($message, $delim = 'must be of the type ') ?: (strpos($message, $delim = 'must be an instance of ') ?: strpos($message, $delim = 'must implement interface '));
193193
$pos += \strlen($delim);
194-
$type = $trace[$i]['args'][0];
195-
$type = \is_object($type) ? \get_class($type) : \gettype($type);
194+
$j = strpos($message, ',', $pos);
195+
$type = substr($message, 2 + $j, strpos($message, ' given', $j) - $j - 2);
196+
$message = substr($message, $pos, $j - $pos);
196197

197-
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given at property path "%s".', substr($message, $pos, strpos($message, ',', $pos) - $pos), $type, $propertyPath));
198+
throw new InvalidArgumentException(sprintf('Expected argument of type "%s", "%s" given at property path "%s".', $message, 'NULL' === $type ? 'null' : $type, $propertyPath));
198199
}
199200
}
200201

src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ public function testThrowTypeError()
546546
public function testThrowTypeErrorWithNullArgument()
547547
{
548548
$this->expectException('Symfony\Component\PropertyAccess\Exception\InvalidArgumentException');
549-
$this->expectExceptionMessage('Expected argument of type "DateTime", "NULL" given');
549+
$this->expectExceptionMessage('Expected argument of type "DateTime", "null" given');
550550
$object = new TypeHinted();
551551

552552
$this->propertyAccessor->setValue($object, 'date', null);

0 commit comments

Comments
 (0)
0