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 23f844e

Browse filesBrowse files
Merge branch '6.1' into 6.2
* 6.1: Update ComposerPlugin.php [Notifier] [OvhCloud] handle invalid receiver [Cache] fix collecting cache stats when nesting computations [VarDumper] Fix JS to expand / collapse [Validator] Fix Email validator logic Fix user_identifier support after username has been deprecated in favor of it. [Tests] Remove `$this` occurrences in future static data providers [PropertyInfo] Fixes constructor extractor for mixed type use method_exists() instead of catching reflection exceptions
2 parents ec73043 + f2f75ee commit 23f844e
Copy full SHA for 23f844e

File tree

Expand file treeCollapse file tree

20 files changed

+137
-54
lines changed
Filter options
Expand file treeCollapse file tree

20 files changed

+137
-54
lines changed

‎src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/DataCollector/CacheDataCollector.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private function calculateStatistics(): array
115115
/** @var TraceableAdapterEvent $call */
116116
foreach ($calls as $call) {
117117
++$statistics[$name]['calls'];
118-
$statistics[$name]['time'] += $call->end - $call->start;
118+
$statistics[$name]['time'] += ($call->end ?? microtime(true)) - $call->start;
119119
if ('get' === $call->name) {
120120
++$statistics[$name]['reads'];
121121
if ($call->hits) {
@@ -137,10 +137,8 @@ private function calculateStatistics(): array
137137
$statistics[$name]['misses'] += $call->misses;
138138
} elseif ('hasItem' === $call->name) {
139139
++$statistics[$name]['reads'];
140-
if (false === $call->result) {
141-
++$statistics[$name]['misses'];
142-
} else {
143-
++$statistics[$name]['hits'];
140+
foreach ($call->result ?? [] as $result) {
141+
++$statistics[$name][$result ? 'hits' : 'misses'];
144142
}
145143
} elseif ('save' === $call->name) {
146144
++$statistics[$name]['writes'];

‎src/Symfony/Component/Cache/Tests/DataCollector/CacheDataCollectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/DataCollector/CacheDataCollectorTest.php
+23-3Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Cache\Tests\DataCollector;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Cache\Adapter\NullAdapter;
1516
use Symfony\Component\Cache\Adapter\TraceableAdapter;
1617
use Symfony\Component\Cache\DataCollector\CacheDataCollector;
1718
use Symfony\Component\HttpFoundation\Request;
@@ -55,16 +56,16 @@ public function testHitedEventDataCollector()
5556
$traceableAdapterEvent->name = 'hasItem';
5657
$traceableAdapterEvent->start = 0;
5758
$traceableAdapterEvent->end = 0;
58-
$traceableAdapterEvent->hits = 1;
59+
$traceableAdapterEvent->hits = 0;
5960
$traceableAdapterEvent->misses = 0;
6061
$traceableAdapterEvent->result = ['foo' => false];
6162

6263
$statistics = $this->getCacheDataCollectorStatisticsFromEvents([$traceableAdapterEvent]);
6364

6465
$this->assertEquals($statistics[self::INSTANCE_NAME]['calls'], 1, 'calls');
6566
$this->assertEquals($statistics[self::INSTANCE_NAME]['reads'], 1, 'reads');
66-
$this->assertEquals($statistics[self::INSTANCE_NAME]['hits'], 1, 'hits');
67-
$this->assertEquals($statistics[self::INSTANCE_NAME]['misses'], 0, 'misses');
67+
$this->assertEquals($statistics[self::INSTANCE_NAME]['hits'], 0, 'hits');
68+
$this->assertEquals($statistics[self::INSTANCE_NAME]['misses'], 1, 'misses');
6869
$this->assertEquals($statistics[self::INSTANCE_NAME]['writes'], 0, 'writes');
6970
}
7071

@@ -84,6 +85,25 @@ public function testSavedEventDataCollector()
8485
$this->assertEquals($statistics[self::INSTANCE_NAME]['writes'], 1, 'writes');
8586
}
8687

88+
public function testCollectBeforeEnd()
89+
{
90+
$adapter = new TraceableAdapter(new NullAdapter());
91+
92+
$collector = new CacheDataCollector();
93+
$collector->addInstance(self::INSTANCE_NAME, $adapter);
94+
95+
$adapter->get('foo', function () use ($collector) {
96+
$collector->collect(new Request(), new Response());
97+
98+
return 123;
99+
});
100+
101+
$stats = $collector->getStatistics();
102+
$this->assertGreaterThan(0, $stats[self::INSTANCE_NAME]['time']);
103+
$this->assertEquals($stats[self::INSTANCE_NAME]['hits'], 0, 'hits');
104+
$this->assertEquals($stats[self::INSTANCE_NAME]['misses'], 1, 'misses');
105+
}
106+
87107
private function getCacheDataCollectorStatisticsFromEvents(array $traceableAdapterEvents)
88108
{
89109
$traceableAdapterMock = $this->createMock(TraceableAdapter::class);

‎src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Tests/Html5ParserCrawlerTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ public function testHtml5ParserWithInvalidHeadedContent(string $content)
4848

4949
public function validHtml5Provider(): iterable
5050
{
51-
$html = $this->getDoctype().'<html><body><h1><p>Foo</p></h1></body></html>';
51+
$html = static::getDoctype().'<html><body><h1><p>Foo</p></h1></body></html>';
5252
$BOM = \chr(0xEF).\chr(0xBB).\chr(0xBF);
5353

5454
yield 'BOM first' => [$BOM.$html];
5555
yield 'Single comment' => ['<!-- comment -->'.$html];
5656
yield 'Multiline comment' => ["<!-- \n multiline comment \n -->".$html];
5757
yield 'Several comments' => ['<!--c--> <!--cc-->'.$html];
5858
yield 'Whitespaces' => [' '.$html];
59-
yield 'All together' => [$BOM.' '.'<!--c-->'.$html];
59+
yield 'All together' => [$BOM.' <!--c-->'.$html];
6060
}
6161

6262
public function invalidHtml5Provider(): iterable
6363
{
64-
$html = $this->getDoctype().'<html><body><h1><p>Foo</p></h1></body></html>';
64+
$html = static::getDoctype().'<html><body><h1><p>Foo</p></h1></body></html>';
6565

6666
yield 'Text' => ['hello world'.$html];
6767
yield 'Text between comments' => ['<!--c--> test <!--cc-->'.$html];

‎src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,19 @@ public function testParseThrowsInsteadOfNotice()
121121

122122
public function shortCircuitProviderEvaluate()
123123
{
124-
$object = $this->getMockBuilder(\stdClass::class)->setMethods(['foo'])->getMock();
125-
$object->expects($this->never())->method('foo');
124+
$object = new class(\Closure::fromCallable([static::class, 'fail'])) {
125+
private $fail;
126+
127+
public function __construct(callable $fail)
128+
{
129+
$this->fail = $fail;
130+
}
131+
132+
public function foo()
133+
{
134+
($this->fail)();
135+
}
136+
};
126137

127138
return [
128139
['false and object.foo()', ['object' => $object], false],

‎src/Symfony/Component/Filesystem/Tests/PathTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Filesystem/Tests/PathTest.php
+23-4Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,30 @@ public function providePathTests(): \Generator
458458
yield ['..', '/webmozart/symfony', '/webmozart'];
459459
}
460460

461+
private static function getPathTests(): \Generator
462+
{
463+
yield from [
464+
// relative to absolute path
465+
['css/style.css', '/webmozart/symfony', '/webmozart/symfony/css/style.css'],
466+
['../css/style.css', '/webmozart/symfony', '/webmozart/css/style.css'],
467+
['../../css/style.css', '/webmozart/symfony', '/css/style.css'],
468+
469+
// relative to root
470+
['css/style.css', '/', '/css/style.css'],
471+
['css/style.css', 'C:', 'C:/css/style.css'],
472+
['css/style.css', 'C:/', 'C:/css/style.css'],
473+
474+
// same sub directories in different base directories
475+
['../../symfony/css/style.css', '/webmozart/css', '/symfony/css/style.css'],
476+
477+
['', '/webmozart/symfony', '/webmozart/symfony'],
478+
['..', '/webmozart/symfony', '/webmozart'],
479+
];
480+
}
481+
461482
public function provideMakeAbsoluteTests(): \Generator
462483
{
463-
foreach ($this->providePathTests() as $set) {
464-
yield $set;
465-
}
484+
yield from static::getPathTests();
466485

467486
// collapse dots
468487
yield ['css/./style.css', '/webmozart/symfony', '/webmozart/symfony/css/style.css'];
@@ -589,7 +608,7 @@ public function testMakeAbsoluteDoesNotFailIfDifferentRoot(string $basePath, str
589608

590609
public function provideMakeRelativeTests(): \Generator
591610
{
592-
foreach ($this->providePathTests() as $set) {
611+
foreach (static::getPathTests() as $set) {
593612
yield [$set[2], $set[1], $set[0]];
594613
}
595614

‎src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ public function getAcceptData()
9595
];
9696

9797
return [
98-
[0, 0, $this->toAbsolute($lessThan1)],
99-
[0, 1, $this->toAbsolute($lessThanOrEqualTo1)],
98+
[0, 0, static::toAbsolute($lessThan1)],
99+
[0, 1, static::toAbsolute($lessThanOrEqualTo1)],
100100
[2, \PHP_INT_MAX, []],
101-
[1, \PHP_INT_MAX, $this->toAbsolute($graterThanOrEqualTo1)],
102-
[1, 1, $this->toAbsolute($equalTo1)],
101+
[1, \PHP_INT_MAX, static::toAbsolute($graterThanOrEqualTo1)],
102+
[1, 1, static::toAbsolute($equalTo1)],
103103
];
104104
}
105105
}

‎src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ public function getAcceptData()
105105
];
106106

107107
return [
108-
[['foo'], $this->toAbsolute($foo)],
109-
[['fo'], $this->toAbsolute($fo)],
110-
[['toto/'], $this->toAbsolute($toto)],
108+
[['foo'], static::toAbsolute($foo)],
109+
[['fo'], static::toAbsolute($fo)],
110+
[['toto/'], static::toAbsolute($toto)],
111111
];
112112
}
113113
}

‎src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function getAcceptData()
5959
];
6060

6161
return [
62-
[FileTypeFilterIterator::ONLY_FILES, $this->toAbsolute($onlyFiles)],
63-
[FileTypeFilterIterator::ONLY_DIRECTORIES, $this->toAbsolute($onlyDirectories)],
62+
[FileTypeFilterIterator::ONLY_FILES, static::toAbsolute($onlyFiles)],
63+
[FileTypeFilterIterator::ONLY_DIRECTORIES, static::toAbsolute($onlyDirectories)],
6464
];
6565
}
6666
}

‎src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,13 @@ public function getAcceptData()
261261
];
262262

263263
return [
264-
[SortableIterator::SORT_BY_NAME, $this->toAbsolute($sortByName)],
265-
[SortableIterator::SORT_BY_TYPE, $this->toAbsolute($sortByType)],
266-
[SortableIterator::SORT_BY_ACCESSED_TIME, $this->toAbsolute($sortByAccessedTime)],
267-
[SortableIterator::SORT_BY_CHANGED_TIME, $this->toAbsolute($sortByChangedTime)],
268-
[SortableIterator::SORT_BY_MODIFIED_TIME, $this->toAbsolute($sortByModifiedTime)],
269-
[SortableIterator::SORT_BY_NAME_NATURAL, $this->toAbsolute($sortByNameNatural)],
270-
[function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }, $this->toAbsolute($customComparison)],
264+
[SortableIterator::SORT_BY_NAME, static::toAbsolute($sortByName)],
265+
[SortableIterator::SORT_BY_TYPE, static::toAbsolute($sortByType)],
266+
[SortableIterator::SORT_BY_ACCESSED_TIME, static::toAbsolute($sortByAccessedTime)],
267+
[SortableIterator::SORT_BY_CHANGED_TIME, static::toAbsolute($sortByChangedTime)],
268+
[SortableIterator::SORT_BY_MODIFIED_TIME, static::toAbsolute($sortByModifiedTime)],
269+
[SortableIterator::SORT_BY_NAME_NATURAL, static::toAbsolute($sortByNameNatural)],
270+
[function (\SplFileInfo $a, \SplFileInfo $b) { return strcmp($a->getRealPath(), $b->getRealPath()); }, static::toAbsolute($customComparison)],
271271
];
272272
}
273273
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/EventListener/ErrorListenerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function controllerProvider()
207207
}];
208208

209209
yield [function ($exception) {
210-
$this->assertInstanceOf(FlattenException::class, $exception);
210+
static::assertInstanceOf(FlattenException::class, $exception);
211211

212212
return new Response('OK: '.$exception->getMessage());
213213
}];

‎src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php
+18-6Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,28 @@ public function testItAddsHandledStamps(array $handlers, array $expectedStamps,
7070

7171
public function itAddsHandledStampsProvider(): iterable
7272
{
73-
$first = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
74-
$first->method('__invoke')->willReturn('first result');
73+
$first = new class() extends HandleMessageMiddlewareTestCallable {
74+
public function __invoke()
75+
{
76+
return 'first result';
77+
}
78+
};
7579
$firstClass = $first::class;
7680

77-
$second = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
78-
$second->method('__invoke')->willReturn(null);
81+
$second = new class() extends HandleMessageMiddlewareTestCallable {
82+
public function __invoke()
83+
{
84+
return null;
85+
}
86+
};
7987
$secondClass = $second::class;
8088

81-
$failing = $this->createPartialMock(HandleMessageMiddlewareTestCallable::class, ['__invoke']);
82-
$failing->method('__invoke')->will($this->throwException(new \Exception('handler failed.')));
89+
$failing = new class() extends HandleMessageMiddlewareTestCallable {
90+
public function __invoke()
91+
{
92+
throw new \Exception('handler failed.');
93+
}
94+
};
8395

8496
yield 'A stamp is added' => [
8597
[$first],

‎src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ protected function doSend(MessageInterface $message): SentMessage
134134

135135
$success = $response->toArray(false);
136136

137+
if (!isset($success['ids'][0])) {
138+
throw new TransportException(sprintf('Attempt to send the SMS to invalid receivers: "%s".', implode(',', $success['invalidReceivers'])), $response);
139+
}
140+
137141
$sentMessage = new SentMessage($message, (string) $this);
138142
$sentMessage->setMessageId($success['ids'][0]);
139143

‎src/Symfony/Component/Notifier/Bridge/OvhCloud/Tests/OvhCloudTransportTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Notifier/Bridge/OvhCloud/Tests/OvhCloudTransportTest.php
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Component\HttpClient\MockHttpClient;
1515
use Symfony\Component\HttpClient\Response\MockResponse;
1616
use Symfony\Component\Notifier\Bridge\OvhCloud\OvhCloudTransport;
17+
use Symfony\Component\Notifier\Exception\TransportException;
1718
use Symfony\Component\Notifier\Message\ChatMessage;
1819
use Symfony\Component\Notifier\Message\MessageInterface;
1920
use Symfony\Component\Notifier\Message\SmsMessage;
@@ -89,4 +90,26 @@ public function testValidSignature(string $message)
8990
$toSign = 'applicationSecret+consumerKey+POST+'.$endpoint.'+'.$body.'+'.$time;
9091
$this->assertSame('$1$'.sha1($toSign), $signature);
9192
}
93+
94+
public function testInvalidReceiver()
95+
{
96+
$smsMessage = new SmsMessage('invalid_receiver', 'lorem ipsum');
97+
98+
$data = json_encode([
99+
'totalCreditsRemoved' => '1',
100+
'invalidReceivers' => ['invalid_receiver'],
101+
'ids' => [],
102+
'validReceivers' => [],
103+
]);
104+
$responses = [
105+
new MockResponse((string) time()),
106+
new MockResponse($data),
107+
];
108+
109+
$transport = $this->createTransport(new MockHttpClient($responses));
110+
111+
$this->expectException(TransportException::class);
112+
$this->expectExceptionMessage('Attempt to send the SMS to invalid receivers: "invalid_receiver"');
113+
$transport->send($smsMessage);
114+
}
92115
}

‎src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Extractor/PhpDocExtractor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function getTypesFromConstructor(string $class, string $property): ?array
180180
}
181181
}
182182

183-
if (!isset($types[0])) {
183+
if (!isset($types[0]) || [] === $types[0]) {
184184
return null;
185185
}
186186

‎src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Extractor/PhpDocExtractorTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ public function constructorTypesProvider()
406406
['dateObject', [new Type(Type::BUILTIN_TYPE_OBJECT, false, 'DateTimeInterface')]],
407407
['dateTime', null],
408408
['ddd', null],
409+
['mixed', null],
409410
];
410411
}
411412

‎src/Symfony/Component/PropertyInfo/Tests/Fixtures/ConstructorDummy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Fixtures/ConstructorDummy.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class ConstructorDummy
2929
* @param \DateTimeZone $timezone
3030
* @param int $date Timestamp
3131
* @param \DateTimeInterface $dateObject
32+
* @param mixed $mixed
3233
*/
33-
public function __construct(\DateTimeZone $timezone, $date, $dateObject, \DateTimeImmutable $dateTime)
34+
public function __construct(\DateTimeZone $timezone, $date, $dateObject, \DateTimeImmutable $dateTime, $mixed)
3435
{
3536
$this->timezone = $timezone->getName();
3637
$this->date = \DateTimeImmutable::createFromFormat('U', $date);

‎src/Symfony/Component/Runtime/Internal/ComposerPlugin.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Runtime/Internal/ComposerPlugin.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function uninstall(Composer $composer, IOInterface $io): void
5858

5959
public function updateAutoloadFile(): void
6060
{
61-
$vendorDir = $this->composer->getConfig()->get('vendor-dir');
61+
$vendorDir = realpath($this->composer->getConfig()->get('vendor-dir'));
6262

6363
if (!is_file($autoloadFile = $vendorDir.'/autoload.php')
6464
|| false === $extra = $this->composer->getPackage()->getExtra()['runtime'] ?? []

‎src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,7 @@ protected function setAttributeValue(object $object, string $attribute, mixed $v
140140
$key = $object::class.':'.$setter;
141141

142142
if (!isset(self::$setterAccessibleCache[$key])) {
143-
try {
144-
// We have to use is_callable() here since method_exists()
145-
// does not "see" protected/private methods
146-
self::$setterAccessibleCache[$key] = \is_callable([$object, $setter]) && !(new \ReflectionMethod($object, $setter))->isStatic();
147-
} catch (\ReflectionException $e) {
148-
// Method does not exist in the class, probably a magic method
149-
self::$setterAccessibleCache[$key] = false;
150-
}
143+
self::$setterAccessibleCache[$key] = method_exists($object, $setter) && \is_callable([$object, $setter]) && !(new \ReflectionMethod($object, $setter))->isStatic();
151144
}
152145

153146
if (self::$setterAccessibleCache[$key]) {

‎src/Symfony/Component/Validator/Constraints/EmailValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/EmailValidator.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Egulias\EmailValidator\Validation\NoRFCWarningsValidation;
1717
use Symfony\Component\Validator\Constraint;
1818
use Symfony\Component\Validator\ConstraintValidator;
19+
use Symfony\Component\Validator\Exception\LogicException;
1920
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
2021
use Symfony\Component\Validator\Exception\UnexpectedValueException;
2122

@@ -74,7 +75,7 @@ public function validate(mixed $value, Constraint $constraint)
7475

7576
if (null === $constraint->mode) {
7677
if (Email::VALIDATION_MODE_STRICT === $this->defaultMode && !class_exists(EguliasEmailValidator::class)) {
77-
throw new LogicException(sprintf('The "egulias/email-validator" component is required to make the "%s" constraint default to strict mode.', EguliasEmailValidator::class));
78+
throw new LogicException(sprintf('The "egulias/email-validator" component is required to make the "%s" constraint default to strict mode.', Email::class));
7879
}
7980

8081
$constraint->mode = $this->defaultMode;

‎src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ protected function getDumpHeader()
158158
};
159159
160160
refStyle.innerHTML = 'pre.sf-dump .sf-dump-compact, .sf-dump-str-collapse .sf-dump-str-collapse, .sf-dump-str-expand .sf-dump-str-expand { display: none; }';
161-
(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle);
161+
doc.head.appendChild(refStyle);
162162
refStyle = doc.createElement('style');
163-
(doc.documentElement.firstElementChild || doc.documentElement.children[0]).appendChild(refStyle);
163+
doc.head.appendChild(refStyle);
164164
165165
if (!doc.addEventListener) {
166166
addEventListener = function (element, eventName, callback) {

0 commit comments

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