8000 [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() by chalasr · Pull Request #18977 · symfony/symfony · GitHub
[go: up one dir, main page]

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
Next Next commit
Add argument to PropertyAccess::createPropertyAccessor
Remove extra arg on PropertyAccessBuilder
  • Loading branch information
chalasr committed Jun 6, 2016
commit e69c6bd7bab884e17d3af9a952774c41b38a7875
18 changes: 14 additions & 4 deletions src/Symfony/Component/PropertyAccess/PropertyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,31 @@ final class PropertyAccess
/**
* Creates a property accessor with the default configuration.
*
* @param bool $throwExceptionOnInvalidIndex
*
* @return PropertyAccessor The new property accessor
*/
public static function createPropertyAccessor()
public static function createPropertyAccessor($throwExceptionOnInvalidIndex = false)
{
return self::createPropertyAccessorBuilder()->getPropertyAccessor();
return self::createPropertyAccessorBuilder($throwExceptionOnInvalidIndex)->getPropertyAccessor();
}

/**
* Creates a property accessor builder.
*
* @param bool $enableExceptionOnInvalidIndex
*
* @return PropertyAccessorBuilder The new property accessor builder
*/
public static function createPropertyAccessorBuilder()
public static function createPropertyAccessorBuilder($enableExceptionOnInvalidIndex = false)
{
return new PropertyAccessorBuilder();
$propertyAccessorBuilder = new PropertyAccessorBuilder();

if ($enableExceptionOnInvalidIndex) {
$propertyAccessorBuilder->enableExceptionOnInvalidIndex();
}

return $propertyAccessorBuilder;
}

/**
Expand Down
0