Skip to content

Commit

Permalink
[DI][Form] Fixed test suite (TimeType changes & unresolved merge conf…
Browse files Browse the repository at this point in the history
…lict)
  • Loading branch information
wouterj authored and fabpot committed Mar 15, 2020
1 parent 14f2d22 commit 18f5b17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Expand Up @@ -994,13 +994,8 @@ public function setDefinition($id, Definition $definition)

$id = (string) $id;

<<<<<<< HEAD
if ('' === $id || '\\' === $id[-1] || \strlen($id) !== strcspn($id, "\0\r\n'")) {
throw new InvalidArgumentException(sprintf('Invalid service id: "%s"', $id));
=======
if ('' === $id || '\\' === substr($id, -1) || \strlen($id) !== strcspn($id, "\0\r\n'")) {
throw new InvalidArgumentException(sprintf('Invalid service id: "%s".', $id));
>>>>>>> 3.4
}

unset($this->aliasDefinitions[$id], $this->removedIds[$id]);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Form/Extension/Core/Type/TimeType.php
Expand Up @@ -60,8 +60,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
}

if ('single_text' === $options['widget']) {
$builder->addViewTransformer(new DateTimeToStringTransformer($options['model_timezone'], $options['view_timezone'], $format));

$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $e) use ($options) {
$data = $e->getData();
if ($data && preg_match('/^(?P<hours>\d{2}):(?P<minutes>\d{2})(?::(?P<seconds>\d{2})(?:\.\d+)?)?$/', $data, $matches)) {
Expand All @@ -86,6 +84,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
}
});
}

$builder->addViewTransformer(new DateTimeToStringTransformer($options['model_timezone'], $options['view_timezone'], $format));
} else {
$hourOptions = $minuteOptions = $secondOptions = [
'error_bubbling' => true,
Expand Down

0 comments on commit 18f5b17

Please sign in to comment.