Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35131b9

Browse files
committed
Keep BC by using func_get_arg
Document param (commented) Fabbot fixes
1 parent e69c6bd commit 35131b9

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccess.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,36 @@ final class PropertyAccess
2121
/**
2222
* Creates a property accessor with the default configuration.
2323
*
24-
* @param bool $throwExceptionOnInvalidIndex
24+
* @param bool $throwExceptionOnInvalidIndex Will be added to the signature in 4.0
2525
*
2626
* @return PropertyAccessor The new property accessor
2727
*/
28-
public static function createPropertyAccessor($throwExceptionOnInvalidIndex = false)
28+
public static function createPropertyAccessor(/* $throwExceptionOnInvalidIndex = false */)
2929
{
30+
$throwExceptionOnInvalidIndex = false;
31+
32+
if (func_num_args()) {
33+
$throwExceptionOnInvalidIndex = func_get_arg(0);
34+
}
35+
3036
return self::createPropertyAccessorBuilder($throwExceptionOnInvalidIndex)->getPropertyAccessor();
3137
}
3238

3339
/**
3440
* Creates a property accessor builder.
3541
*
36-
* @param bool $enableExceptionOnInvalidIndex
42+
* @param bool $enableExceptionOnInvalidIndex Will be added to the signature in 4.0.
3743
*
3844
* @return PropertyAccessorBuilder The new property accessor builder
3945
*/
40-
public static function createPropertyAccessorBuilder($enableExceptionOnInvalidIndex = false)
46+
public static function createPropertyAccessorBuilder(/* $enableExceptionOnInvalidIndex = false */)
4147
{
4248
$propertyAccessorBuilder = new PropertyAccessorBuilder();
49+
$enableExceptionOnInvalidIndex = false;
50+
51+
if (func_num_args()) {
52+
$enableExceptionOnInvalidIndex = func_get_arg(0);
53+
}
4354

4455
if ($enableExceptionOnInvalidIndex) {
4556
$propertyAccessorBuilder->enableExceptionOnInvalidIndex();

0 commit comments

Comments
 (0)