Revert "feature #18977 [PropertyAccess] Add missing arguments to PropertyAccess::createPropertyAccessor() (chalasr)"
This reverts commit86eb7a3339
, reversing changes made to856c9f6024
.
This commit is contained in:
parent
f2ee67feae
commit
a4ce063029
@ -21,35 +21,21 @@ final class PropertyAccess
|
||||
/**
|
||||
* Creates a property accessor with the default configuration.
|
||||
*
|
||||
* @param bool $throwExceptionOnInvalidIndex
|
||||
*
|
||||
* @return PropertyAccessor The new property accessor
|
||||
*/
|
||||
public static function createPropertyAccessor($throwExceptionOnInvalidIndex = false, $magicCall = false)
|
||||
public static function createPropertyAccessor()
|
||||
{
|
||||
return self::createPropertyAccessorBuilder($throwExceptionOnInvalidIndex, $magicCall)->getPropertyAccessor();
|
||||
return self::createPropertyAccessorBuilder()->getPropertyAccessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a property accessor builder.
|
||||
*
|
||||
* @param bool $enableExceptionOnInvalidIndex
|
||||
*
|
||||
* @return PropertyAccessorBuilder The new property accessor builder
|
||||
*/
|
||||
public static function createPropertyAccessorBuilder($enableExceptionOnInvalidIndex = false, $enableMagicCall = false)
|
||||
public static function createPropertyAccessorBuilder()
|
||||
{
|
||||
$propertyAccessorBuilder = new PropertyAccessorBuilder();
|
||||
|
||||
if ($enableExceptionOnInvalidIndex) {
|
||||
$propertyAccessorBuilder->enableExceptionOnInvalidIndex();
|
||||
}
|
||||
|
||||
if ($enableMagicCall) {
|
||||
$propertyAccessorBuilder->enableMagicCall();
|
||||
}
|
||||
|
||||
return $propertyAccessorBuilder;
|
||||
return new PropertyAccessorBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\PropertyAccess\Tests;
|
||||
|
||||
use Symfony\Component\PropertyAccess\PropertyAccess;
|
||||
use Symfony\Component\PropertyAccess\PropertyAccessor;
|
||||
|
||||
/**
|
||||
* @author Robin Chalas <robin.chalas@gmail.com
|
||||
*/
|
||||
final class PropertyAccessTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testCreatePropertyAccessor()
|
||||
{
|
||||
$this->assertInstanceOf(PropertyAccessor::class, PropertyAccess::createPropertyAccessor());
|
||||
}
|
||||
|
||||
public function testCreatePropertyAccessorWithExceptionOnInvalidIndex()
|
||||
{
|
||||
$this->assertInstanceOf(PropertyAccessor::class, PropertyAccess::createPropertyAccessor(true));
|
||||
}
|
||||
|
||||
public function testCreatePropertyAccessorWithMagicCallEnabled()
|
||||
{
|
||||
$this->assertInstanceOf(PropertyAccessor::class, PropertyAccess::createPropertyAccessor(false, true));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user