8000 [Form] only use PropertyPath if not already callable by Tobion · Pull Request #15561 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] only use PropertyPath if not already callable #15561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Form] only use PropertyPath if not already callable
  • Loading branch information
Tobion committed Aug 15, 2015
commit 470b1400d631ff167bf82851a7975e2299da0856
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function getDecoratedFactory()
*/
public function createListFromChoices($choices, $value = null)
{
if (is_string($value)) {
if (is_string($value) && !is_callable($value)) {
$value = new PropertyPath($value);
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public function createListFromFlippedChoices($choices, $value = null)
*/
public function createListFromLoader(ChoiceLoaderInterface $loader, $value = null)
{
if (is_string($value)) {
if (is_string($value) && !is_callable($value)) {
$value = new PropertyPath($value);
}

Expand Down Expand Up @@ -164,7 +164,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
{
$accessor = $this->propertyAccessor;

if (is_string($label)) {
if (is_string($label) && !is_callable($label)) {
$label = new PropertyPath($label);
}

Expand All @@ -174,7 +174,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
};
}

if (is_string($preferredChoices)) {
if (is_string($preferredChoices) && !is_callable($preferredChoices)) {
$preferredChoices = new PropertyPath($preferredChoices);
}

Expand All @@ -189,7 +189,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
};
}

if (is_string($index)) {
if (is_string($index) && !is_callable($index)) {
$index = new PropertyPath($index);
}

Expand All @@ -199,7 +199,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
};
}

if (is_string($groupBy)) {
if (is_string($groupBy) && !is_callable($groupBy)) {
$groupBy = new PropertyPath($groupBy);
}

Expand All @@ -213,7 +213,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
};
}

if (is_string($attr)) {
if (is_string($attr) && !is_callable($attr)) {
$attr = new PropertyPath($attr);
}

Expand Down
0