File tree 1 file changed +14
-4
lines changed
src/Symfony/Component/PropertyAccess
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,31 @@ final class PropertyAccess
21
21
/**
22
22
* Creates a property accessor with the default configuration.
23
23
*
24
+ * @param bool $throwExceptionOnInvalidIndex
25
+ *
24
26
* @return PropertyAccessor The new property accessor
25
27
*/
26
- public static function createPropertyAccessor ()
28
+ public static function createPropertyAccessor ($ throwExceptionOnInvalidIndex = false )
27
29
{
28
- return self ::createPropertyAccessorBuilder ()->getPropertyAccessor ();
30
+ return self ::createPropertyAccessorBuilder ($ throwExceptionOnInvalidIndex )->getPropertyAccessor ();
29
31
}
30
32
31
33
/**
32
34
* Creates a property accessor builder.
33
35
*
36
+ * @param bool $enableExceptionOnInvalidIndex
37
+ *
34
38
* @return PropertyAccessorBuilder The new property accessor builder
35
39
*/
36
- public static function createPropertyAccessorBuilder ()
40
+ public static function createPropertyAccessorBuilder ($ enableExceptionOnInvalidIndex = false )
37
41
{
38
- return new PropertyAccessorBuilder ();
42
+ $ propertyAccessorBuilder = new PropertyAccessorBuilder ();
43
+
44
+ if ($ enableExceptionOnInvalidIndex ) {
45
+ $ propertyAccessorBuilder ->enableExceptionOnInvalidIndex ();
46
+ }
47
+
48
+ return $ propertyAccessorBuilder ;
39
49
}
40
50
41
51
/**
You can’t perform that action at this time.
0 commit comments