Skip to content

Commit 14baea1

Browse files
Merge branch '4.1'
* 4.1: (27 commits) Added the Code of Conduct file do not override custom access decision configs [Security] Do not deauthenticate user when the first refreshed user has changed fix a return type hint invalidate stale commits for PRs too add missing cache prefix seed attribute to XSD fix command description Fix class documentation [Validator] Add a missing translation [FrameworkBundle] Fix 3.4 tests [DI] fix dumping inline services again Rename consumer to receiver Register messenger before the profiler Fix phpdocs [EventDispatcher] Remove template method in test case Added LB translation for #27993 (UUID validator message translation) Replace deprecated validateValue with validate [FWBundle] Automatically enable PropertyInfo when using Flex [Process] fix locking of pipe files on Windows Correct PHPDoc type for float ttl ...
2 parents 64ecf8c + 51066f3 commit 14baea1

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function reverseTransform($rfc3339)
6868
return;
6969
}
7070

71-
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2})?(?:\.\d)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))$/', $rfc3339, $matches)) {
71+
if (!preg_match('/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))$/', $rfc3339, $matches)) {
7272
throw new TransformationFailedException(sprintf('The date "%s" is not a valid date.', $rfc3339));
7373
}
7474

FormBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ public function getIterator()
235235
}
236236

237237
/**
238-
* Converts an unresolved child into a {@link FormBuilder} instance.
238+
* Converts an unresolved child into a {@link FormBuilderInterface} instance.
239239
*/
240-
private function resolveChild(string $name): self
240+
private function resolveChild(string $name): FormBuilderInterface
241241
{
242242
$info = $this->unresolvedChildren[$name];
243243
$child = $this->create($name, $info['type'], $info['options']);

Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function reverseTransformProvider()
6767
array('UTC', 'UTC', '2010-02-03 04:05:00 UTC', '2010-02-03T04:05Z'),
6868
array('America/New_York', 'Asia/Hong_Kong', '2010-02-03 04:05:00 America/New_York', '2010-02-03T17:05+08:00'),
6969
array('Europe/Amsterdam', 'Europe/Amsterdam', '2013-08-21 10:30:00 Europe/Amsterdam', '2013-08-21T08:30:00Z'),
70+
array('UTC', 'UTC', '2018-10-03T10:00:00.000Z', '2018-10-03T10:00:00.000Z'),
7071
));
7172
}
7273

Tests/FormBuilderTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Form\ButtonBuilder;
16+
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
1617
use Symfony\Component\Form\FormBuilder;
18+
use Symfony\Component\Form\FormFactoryBuilder;
1719
use Symfony\Component\Form\SubmitButtonBuilder;
1820

1921
class FormBuilderTest extends TestCase
@@ -228,6 +230,14 @@ public function testGetFormConfigErasesReferences()
228230
$this->assertEmpty($unresolvedChildren->getValue($config));
229231
}
230232

233+
public function testGetButtonBuilderBeforeExplicitlyResolvingAllChildren()
234+
{
235+
$builder = new FormBuilder('name', null, $this->dispatcher, (new FormFactoryBuilder())->getFormFactory());
236+
$builder->add('submit', SubmitType::class);
237+
238+
$this->assertInstanceOf(ButtonBuilder::class, $builder->get('submit'));
239+
}
240+
231241
private function getFormBuilder($name = 'name')
232242
{
233243
$mock = $this->getMockBuilder('Symfony\Component\Form\FormBuilder')

0 commit comments

Comments
 (0)