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
Show file tree
Hide file tree
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
Remove hack
  • Loading branch information
chalasr committed Jun 7, 2016
commit fa8b71144d5f214dd3fa275d801bd727db02d2a0
19 changes: 4 additions & 15 deletions src/Symfony/Component/PropertyAccess/PropertyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,25 @@ final class PropertyAccess
/**
* Creates a property accessor with the default configuration.
*
* @param bool $throwExceptionOnInvalidIndex Will be added to the signature in 4.0
* @param bool $throwExceptionOnInvalidIndex
*
* @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 Will be added to the signature in 4.0.
* @param bool $enableExceptionOnInvalidIndex
*
* @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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @author Robin Chalas <robin.chalas@gmail.com
*/
class PropertyAccessTest extends \PHPUnit_Framework_TestCase
final class PropertyAccessTest extends \PHPUnit_Framework_TestCase
{
public function testCreatePropertyAccessor()
{
Expand Down
0