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

Skip to content

[PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() #18977

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

Closed
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Keep BC by using func_get_arg
Document param (commented)

Fabbot fixes
  • Loading branch information
chalasr committed Jun 6, 2016
commit 35131b9b5df5068d0b8a607f80c095e0aebe2b58
19 changes: 15 additions & 4 deletions src/Symfony/Component/PropertyAccess/PropertyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,36 @@ final class PropertyAccess
/**
* Creates a property accessor with the default configuration.
*
* @param bool $throwExceptionOnInvalidIndex
* @param bool $throwExceptionOnInvalidIndex Will be added to the signature in 4.0
*
* @return PropertyAccessor The new property accessor
*/
public static function createPropertyAccessor($throwExceptionOnInvalidIndex = false)
public static function createPropertyAccessor(/* $throwExceptionOnInvalidIndex = false */)
{
$throwExceptionOnInvalidIndex = false;

if (func_num_args()) {
$throwExceptionOnInvalidIndex = func_get_arg(0);
}

return self::createPropertyAccessorBuilder($throwExceptionOnInvalidIndex)->getPropertyAccessor();
}

/**
* Creates a property accessor builder.
*
* @param bool $enableExceptionOnInvalidIndex
* @param bool $enableExceptionOnInvalidIndex Will be added to the signature in 4.0.
*
* @return PropertyAccessorBuilder The new property accessor builder
*/
public static function createPropertyAccessorBuilder($enableExceptionOnInvalidIndex = false)
public static function createPropertyAccessorBuilder(/* $enableExceptionOnInvalidIndex = false */)
{
$propertyAccessorBuilder = new PropertyAccessorBuilder();
$enableExceptionOnInvalidIndex = false;

if (func_num_args()) {
$enableExceptionOnInvalidIndex = func_get_arg(0);
}

if ($enableExceptionOnInvalidIndex) {
$propertyAccessorBuilder->enableExceptionOnInvalidIndex();
Expand Down