8000 bug #16615 fix type assignement (rande) · symfony/symfony@cd0ffc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit cd0ffc9

Browse files
committed
bug #16615 fix type assignement (rande)
This PR was squashed before being merged into the 3.0-dev branch (closes #16615). Discussion ---------- fix type assignement | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR make sure the original key is used when the type is resolved. Also the code now respect the PHPDoc. Commits ------- cc26454 fix type assignement
2 parents b859d95 + cc26454 commit cd0ffc9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Form/FormRegistry.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function getType($name)
8888
}
8989
}
9090

91-
$this->resolveAndAddType($type);
91+
$this->types[$name] = $this->resolveType($type);
9292
}
9393

9494
return $this->types[$name];
@@ -102,7 +102,7 @@ public function getType($name)
102102
*
103103
* @return ResolvedFormTypeInterface The resolved type.
104104
*/
105-
private function resolveAndAddType(FormTypeInterface $type)
105+
private function resolveType(FormTypeInterface $type)
106106
{
107107
$typeExtensions = array();
108108
$parentType = $type->getParent();
@@ -115,13 +115,11 @@ private function resolveAndAddType(FormTypeInterface $type)
115115
);
116116
}
117117

118-
$resolvedType = $this->resolvedTypeFactory->createResolvedType(
118+
return $this->resolvedTypeFactory->createResolvedType(
119119
$type,
120120
$typeExtensions,
121121
$parentType ? $this->getType($parentType) : null
122122
);
123-
124-
$this->types[$fqcn] = $resolvedType;
125123
}
126124

127125
/**

0 commit comments

Comments
 (0)
0