You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adds property path support to a choice list factory.
@@ -59,9 +60,8 @@ public function getDecoratedFactory()
59
60
/**
60
61
* {@inheritdoc}
61
62
*
62
-
* @param iterable $choices The choices
63
-
* @param callable|string|PropertyPath|null $value The callable or path for
64
-
* generating the choice values
63
+
* @param iterable $choices The choices
64
+
* @param callable|string|PropertyPathInterface|null $value The callable or path for generating the choice values
65
65
*
66
66
* @return ChoiceListInterface The choice list
67
67
*/
@@ -73,7 +73,7 @@ public function createListFromChoices($choices, $value = null)
73
73
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
74
74
}
75
75
76
-
if ($valueinstanceofPropertyPath) {
76
+
if ($valueinstanceofPropertyPathInterface) {
77
77
$accessor = $this->propertyAccessor;
78
78
$value = function ($choice) use ($accessor, $value) {
79
79
// The callable may be invoked with a non-object/array value
@@ -92,9 +92,8 @@ public function createListFromChoices($choices, $value = null)
92
92
/**
93
93
* {@inheritdoc}
94
94
*
95
-
* @param ChoiceLoaderInterface $loader The choice loader
96
-
* @param callable|string|PropertyPath|null $value The callable or path for
97
-
* generating the choice values
95
+
* @param ChoiceLoaderInterface $loader The choice loader
96
+
* @param callable|string|PropertyPathInterface|null $value The callable or path for generating the choice values
98
97
*
99
98
* @return ChoiceListInterface The choice list
100
99
*/
@@ -106,7 +105,7 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
106
105
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
107
106
}
108
107
109
-
if ($valueinstanceofPropertyPath) {
108
+
if ($valueinstanceofPropertyPathInterface) {
110
109
$accessor = $this->propertyAccessor;
111
110
$value = function ($choice) use ($accessor, $value) {
112
111
// The callable may be invoked with a non-object/array value
@@ -125,12 +124,12 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul
125
124
/**
126
125
* {@inheritdoc}
127
126
*
128
-
* @param ChoiceListInterface $list The choice list
129
-
* @param array|callable|string|PropertyPath|null $preferredChoices The preferred choices
130
-
* @param callable|string|PropertyPath|null $label The callable or path generating the choice labels
131
-
* @param callable|string|PropertyPath|null $index The callable or path generating the view indices
132
-
* @param callable|string|PropertyPath|null $groupBy The callable or path generating the group names
133
-
* @param array|callable|string|PropertyPath|null $attr The callable or path generating the HTML attributes
127
+
* @param ChoiceListInterface $list The choice list
128
+
* @param array|callable|string|PropertyPathInterface|null $preferredChoices The preferred choices
129
+
* @param callable|string|PropertyPathInterface|null $label The callable or path generating the choice labels
130
+
* @param callable|string|PropertyPathInterface|null $index The callable or path generating the view indices
131
+
* @param callable|string|PropertyPathInterface|null $groupBy The callable or path generating the group names
132
+
* @param array|callable|string|PropertyPathInterface|null $attr The callable or path generating the HTML attributes
134
133
*
135
134
* @return ChoiceListView The choice list view
136
135
*/
@@ -144,7 +143,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
144
143
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
145
144
}
146
145
147
-
if ($labelinstanceofPropertyPath) {
146
+
if ($labelinstanceofPropertyPathInterface) {
148
147
$label = function ($choice) use ($accessor, $label) {
149
148
return$accessor->getValue($choice, $label);
150
149
};
@@ -156,7 +155,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
156
155
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
157
156
}
158
157
159
-
if ($preferredChoicesinstanceofPropertyPath) {
158
+
if ($preferredChoicesinstanceofPropertyPathInterface) {
160
159
$preferredChoices = function ($choice) use ($accessor, $preferredChoices) {
@@ -173,7 +172,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
173
172
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
174
173
}
175
174
176
-
if ($indexinstanceofPropertyPath) {
175
+
if ($indexinstanceofPropertyPathInterface) {
177
176
$index = function ($choice) use ($accessor, $index) {
178
177
return$accessor->getValue($choice, $index);
179
178
};
@@ -185,7 +184,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
185
184
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
186
185
}
187
186
188
-
if ($groupByinstanceofPropertyPath) {
187
+
if ($groupByinstanceofPropertyPathInterface) {
189
188
$groupBy = function ($choice) use ($accessor, $groupBy) {
190
189
try {
191
190
return$accessor->getValue($choice, $groupBy);
@@ -201,7 +200,7 @@ public function createView(ChoiceListInterface $list, $preferredChoices = null,
201
200
@trigger_error('Passing callable strings is deprecated since Symfony 3.1 and PropertyAccessDecorator will treat them as property paths in 4.0. You should use a "\Closure" instead.', E_USER_DEPRECATED);
202
201
}
203
202
204
-
if ($attrinstanceofPropertyPath) {
203
+
if ($attrinstanceofPropertyPathInterface) {
205
204
$attr = function ($choice) use ($accessor, $attr) {
0 commit comments