Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
24
vendor/symfony/validator/Tests/Fixtures/CallbackClass.php
vendored
Normal file
24
vendor/symfony/validator/Tests/Fixtures/CallbackClass.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*/
|
||||
class CallbackClass
|
||||
{
|
||||
public static function callback($object, ExecutionContextInterface $context)
|
||||
{
|
||||
}
|
||||
}
|
22
vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php
vendored
Normal file
22
vendor/symfony/validator/Tests/Fixtures/ClassConstraint.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
class ClassConstraint extends Constraint
|
||||
{
|
||||
public function getTargets()
|
||||
{
|
||||
return self::CLASS_CONSTRAINT;
|
||||
}
|
||||
}
|
31
vendor/symfony/validator/Tests/Fixtures/ConstraintA.php
vendored
Normal file
31
vendor/symfony/validator/Tests/Fixtures/ConstraintA.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/** @Annotation */
|
||||
class ConstraintA extends Constraint
|
||||
{
|
||||
public $property1;
|
||||
public $property2;
|
||||
|
||||
public function getDefaultOption()
|
||||
{
|
||||
return 'property2';
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
37
vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php
vendored
Normal file
37
vendor/symfony/validator/Tests/Fixtures/ConstraintAValidator.php
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
|
||||
class ConstraintAValidator extends ConstraintValidator
|
||||
{
|
||||
public static $passedContext;
|
||||
|
||||
public function initialize(ExecutionContextInterface $context)
|
||||
{
|
||||
parent::initialize($context);
|
||||
|
||||
self::$passedContext = $context;
|
||||
}
|
||||
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
if ('VALID' != $value) {
|
||||
$this->context->addViolation('message', array('param' => 'value'));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
23
vendor/symfony/validator/Tests/Fixtures/ConstraintB.php
vendored
Normal file
23
vendor/symfony/validator/Tests/Fixtures/ConstraintB.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/** @Annotation */
|
||||
class ConstraintB extends Constraint
|
||||
{
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
30
vendor/symfony/validator/Tests/Fixtures/ConstraintC.php
vendored
Normal file
30
vendor/symfony/validator/Tests/Fixtures/ConstraintC.php
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/** @Annotation */
|
||||
class ConstraintC extends Constraint
|
||||
{
|
||||
public $option1;
|
||||
|
||||
public function getRequiredOptions()
|
||||
{
|
||||
return array('option1');
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
31
vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php
vendored
Normal file
31
vendor/symfony/validator/Tests/Fixtures/ConstraintWithValue.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/** @Annotation */
|
||||
class ConstraintWithValue extends Constraint
|
||||
{
|
||||
public $property;
|
||||
public $value;
|
||||
|
||||
public function getDefaultOption()
|
||||
{
|
||||
return 'property';
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
31
vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php
vendored
Normal file
31
vendor/symfony/validator/Tests/Fixtures/ConstraintWithValueAsDefault.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
/** @Annotation */
|
||||
class ConstraintWithValueAsDefault extends Constraint
|
||||
{
|
||||
public $property;
|
||||
public $value;
|
||||
|
||||
public function getDefaultOption()
|
||||
{
|
||||
return 'value';
|
||||
}
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
27
vendor/symfony/validator/Tests/Fixtures/Countable.php
vendored
Normal file
27
vendor/symfony/validator/Tests/Fixtures/Countable.php
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
class Countable implements \Countable
|
||||
{
|
||||
private $content;
|
||||
|
||||
public function __construct(array $content)
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->content);
|
||||
}
|
||||
}
|
70
vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php
vendored
Normal file
70
vendor/symfony/validator/Tests/Fixtures/CustomArrayObject.php
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
/**
|
||||
* This class is a hand written simplified version of PHP native `ArrayObject`
|
||||
* class, to show that it behaves differently than the PHP native implementation.
|
||||
*/
|
||||
class CustomArrayObject implements \ArrayAccess, \IteratorAggregate, \Countable, \Serializable
|
||||
{
|
||||
private $array;
|
||||
|
||||
public function __construct(array $array = null)
|
||||
{
|
||||
$this->array = $array ?: array();
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return array_key_exists($offset, $this->array);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return $this->array[$offset];
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (null === $offset) {
|
||||
$this->array[] = $value;
|
||||
} else {
|
||||
$this->array[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->array[$offset]);
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
{
|
||||
return new \ArrayIterator($this->array);
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
return count($this->array);
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
return serialize($this->array);
|
||||
}
|
||||
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
$this->array = (array) unserialize((string) $serialized);
|
||||
}
|
||||
}
|
100
vendor/symfony/validator/Tests/Fixtures/Entity.php
vendored
Normal file
100
vendor/symfony/validator/Tests/Fixtures/Entity.php
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||
|
||||
/**
|
||||
* @Symfony\Component\Validator\Tests\Fixtures\ConstraintA
|
||||
* @Assert\GroupSequence({"Foo", "Entity"})
|
||||
* @Assert\Callback({"Symfony\Component\Validator\Tests\Fixtures\CallbackClass", "callback"})
|
||||
*/
|
||||
class Entity extends EntityParent implements EntityInterface
|
||||
{
|
||||
/**
|
||||
* @Assert\NotNull
|
||||
* @Assert\Range(min=3)
|
||||
* @Assert\All({@Assert\NotNull, @Assert\Range(min=3)}),
|
||||
* @Assert\All(constraints={@Assert\NotNull, @Assert\Range(min=3)})
|
||||
* @Assert\Collection(fields={
|
||||
* "foo" = {@Assert\NotNull, @Assert\Range(min=3)},
|
||||
* "bar" = @Assert\Range(min=5)
|
||||
* })
|
||||
* @Assert\Choice(choices={"A", "B"}, message="Must be one of %choices%")
|
||||
*/
|
||||
public $firstName;
|
||||
protected $lastName;
|
||||
public $reference;
|
||||
public $reference2;
|
||||
private $internal;
|
||||
public $data = 'Overridden data';
|
||||
public $initialized = false;
|
||||
|
||||
public function __construct($internal = null)
|
||||
{
|
||||
$this->internal = $internal;
|
||||
}
|
||||
|
||||
public function getInternal()
|
||||
{
|
||||
return $this->internal.' from getter';
|
||||
}
|
||||
|
||||
public function setLastName($lastName)
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\NotNull
|
||||
*/
|
||||
public function getLastName()
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\IsTrue
|
||||
*/
|
||||
public function isValid()
|
||||
{
|
||||
return 'valid';
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\IsTrue
|
||||
*/
|
||||
public function hasPermissions()
|
||||
{
|
||||
return 'permissions';
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return 'Overridden data';
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\Callback
|
||||
*/
|
||||
public function validateMe(ExecutionContextInterface $context)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @Assert\Callback
|
||||
*/
|
||||
public static function validateMeStatic($object, ExecutionContextInterface $context)
|
||||
{
|
||||
}
|
||||
}
|
16
vendor/symfony/validator/Tests/Fixtures/EntityInterface.php
vendored
Normal file
16
vendor/symfony/validator/Tests/Fixtures/EntityInterface.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
interface EntityInterface
|
||||
{
|
||||
}
|
31
vendor/symfony/validator/Tests/Fixtures/EntityParent.php
vendored
Normal file
31
vendor/symfony/validator/Tests/Fixtures/EntityParent.php
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\NotNull;
|
||||
|
||||
class EntityParent
|
||||
{
|
||||
protected $firstName;
|
||||
private $internal;
|
||||
private $data = 'Data';
|
||||
|
||||
/**
|
||||
* @NotNull
|
||||
*/
|
||||
protected $other;
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return 'Data';
|
||||
}
|
||||
}
|
24
vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php
vendored
Normal file
24
vendor/symfony/validator/Tests/Fixtures/FailingConstraint.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
class FailingConstraint extends Constraint
|
||||
{
|
||||
public $message = 'Failed';
|
||||
|
||||
public function getTargets()
|
||||
{
|
||||
return array(self::PROPERTY_CONSTRAINT, self::CLASS_CONSTRAINT);
|
||||
}
|
||||
}
|
23
vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php
vendored
Normal file
23
vendor/symfony/validator/Tests/Fixtures/FailingConstraintValidator.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\ConstraintValidator;
|
||||
|
||||
class FailingConstraintValidator extends ConstraintValidator
|
||||
{
|
||||
public function validate($value, Constraint $constraint)
|
||||
{
|
||||
$this->context->addViolation($constraint->message, array());
|
||||
}
|
||||
}
|
26
vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php
vendored
Normal file
26
vendor/symfony/validator/Tests/Fixtures/FakeClassMetadata.php
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Mapping\ClassMetadata;
|
||||
|
||||
class FakeClassMetadata extends ClassMetadata
|
||||
{
|
||||
public function addCustomPropertyMetadata($propertyName, $metadata)
|
||||
{
|
||||
if (!isset($this->members[$propertyName])) {
|
||||
$this->members[$propertyName] = array();
|
||||
}
|
||||
|
||||
$this->members[$propertyName][] = $metadata;
|
||||
}
|
||||
}
|
72
vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php
vendored
Normal file
72
vendor/symfony/validator/Tests/Fixtures/FakeMetadataFactory.php
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Exception\NoSuchMetadataException;
|
||||
use Symfony\Component\Validator\MetadataFactoryInterface;
|
||||
use Symfony\Component\Validator\MetadataInterface;
|
||||
|
||||
class FakeMetadataFactory implements MetadataFactoryInterface
|
||||
{
|
||||
protected $metadatas = array();
|
||||
|
||||
public function getMetadataFor($class)
|
||||
{
|
||||
$hash = null;
|
||||
|
||||
if (is_object($class)) {
|
||||
$hash = spl_object_hash($class);
|
||||
$class = get_class($class);
|
||||
}
|
||||
|
||||
if (!is_string($class)) {
|
||||
throw new NoSuchMetadataException(sprintf('No metadata for type %s', gettype($class)));
|
||||
}
|
||||
|
||||
if (!isset($this->metadatas[$class])) {
|
||||
if (isset($this->metadatas[$hash])) {
|
||||
return $this->metadatas[$hash];
|
||||
}
|
||||
|
||||
throw new NoSuchMetadataException(sprintf('No metadata for "%s"', $class));
|
||||
}
|
||||
|
||||
return $this->metadatas[$class];
|
||||
}
|
||||
|
||||
public function hasMetadataFor($class)
|
||||
{
|
||||
$hash = null;
|
||||
|
||||
if (is_object($class)) {
|
||||
$hash = spl_object_hash($class);
|
||||
$class = get_class($class);
|
||||
}
|
||||
|
||||
if (!is_string($class)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isset($this->metadatas[$class]) || isset($this->metadatas[$hash]);
|
||||
}
|
||||
|
||||
public function addMetadata($metadata)
|
||||
{
|
||||
$this->metadatas[$metadata->getClassName()] = $metadata;
|
||||
}
|
||||
|
||||
public function addMetadataForValue($value, MetadataInterface $metadata)
|
||||
{
|
||||
$key = is_object($value) ? spl_object_hash($value) : $value;
|
||||
$this->metadatas[$key] = $metadata;
|
||||
}
|
||||
}
|
39
vendor/symfony/validator/Tests/Fixtures/FilesLoader.php
vendored
Normal file
39
vendor/symfony/validator/Tests/Fixtures/FilesLoader.php
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Mapping\Loader\FilesLoader as BaseFilesLoader;
|
||||
use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;
|
||||
|
||||
abstract class FilesLoader extends BaseFilesLoader
|
||||
{
|
||||
protected $timesCalled = 0;
|
||||
protected $loader;
|
||||
|
||||
public function __construct(array $paths, LoaderInterface $loader)
|
||||
{
|
||||
$this->loader = $loader;
|
||||
parent::__construct($paths);
|
||||
}
|
||||
|
||||
protected function getFileLoaderInstance($file)
|
||||
{
|
||||
++$this->timesCalled;
|
||||
|
||||
return $this->loader;
|
||||
}
|
||||
|
||||
public function getTimesCalled()
|
||||
{
|
||||
return $this->timesCalled;
|
||||
}
|
||||
}
|
36
vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php
vendored
Normal file
36
vendor/symfony/validator/Tests/Fixtures/GroupSequenceProviderEntity.php
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Symfony\Component\Validator\GroupSequenceProviderInterface;
|
||||
|
||||
/**
|
||||
* @Assert\GroupSequenceProvider
|
||||
*/
|
||||
class GroupSequenceProviderEntity implements GroupSequenceProviderInterface
|
||||
{
|
||||
public $firstName;
|
||||
public $lastName;
|
||||
|
||||
protected $sequence = array();
|
||||
|
||||
public function __construct($sequence)
|
||||
{
|
||||
$this->sequence = $sequence;
|
||||
}
|
||||
|
||||
public function getGroupSequence()
|
||||
{
|
||||
return $this->sequence;
|
||||
}
|
||||
}
|
18
vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php
vendored
Normal file
18
vendor/symfony/validator/Tests/Fixtures/InvalidConstraint.php
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
class InvalidConstraint extends Constraint
|
||||
{
|
||||
}
|
16
vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php
vendored
Normal file
16
vendor/symfony/validator/Tests/Fixtures/InvalidConstraintValidator.php
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
class InvalidConstraintValidator
|
||||
{
|
||||
}
|
20
vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php
vendored
Normal file
20
vendor/symfony/validator/Tests/Fixtures/LegacyClassMetadata.php
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\ClassBasedInterface;
|
||||
use Symfony\Component\Validator\MetadataInterface;
|
||||
use Symfony\Component\Validator\PropertyMetadataContainerInterface;
|
||||
|
||||
interface LegacyClassMetadata extends MetadataInterface, PropertyMetadataContainerInterface, ClassBasedInterface
|
||||
{
|
||||
}
|
22
vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php
vendored
Normal file
22
vendor/symfony/validator/Tests/Fixtures/PropertyConstraint.php
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
|
||||
class PropertyConstraint extends Constraint
|
||||
{
|
||||
public function getTargets()
|
||||
{
|
||||
return self::PROPERTY_CONSTRAINT;
|
||||
}
|
||||
}
|
29
vendor/symfony/validator/Tests/Fixtures/Reference.php
vendored
Normal file
29
vendor/symfony/validator/Tests/Fixtures/Reference.php
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
class Reference
|
||||
{
|
||||
public $value;
|
||||
|
||||
private $privateValue;
|
||||
|
||||
public function setPrivateValue($privateValue)
|
||||
{
|
||||
$this->privateValue = $privateValue;
|
||||
}
|
||||
|
||||
public function getPrivateValue()
|
||||
{
|
||||
return $this->privateValue;
|
||||
}
|
||||
}
|
70
vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php
vendored
Normal file
70
vendor/symfony/validator/Tests/Fixtures/StubGlobalExecutionContext.php
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
<?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\Validator\Tests\Fixtures;
|
||||
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Component\Validator\GlobalExecutionContextInterface;
|
||||
use Symfony\Component\Validator\ValidationVisitorInterface;
|
||||
|
||||
/**
|
||||
* @since 2.5.3
|
||||
*
|
||||
* @author Bernhard Schussek <bschussek@gmail.com>
|
||||
*
|
||||
* @deprecated since version 2.5, to be removed in 3.0
|
||||
*/
|
||||
class StubGlobalExecutionContext implements GlobalExecutionContextInterface
|
||||
{
|
||||
private $violations;
|
||||
private $root;
|
||||
private $visitor;
|
||||
|
||||
public function __construct($root = null, ValidationVisitorInterface $visitor = null)
|
||||
{
|
||||
$this->violations = new ConstraintViolationList();
|
||||
$this->root = $root;
|
||||
$this->visitor = $visitor;
|
||||
}
|
||||
|
||||
public function getViolations()
|
||||
{
|
||||
return $this->violations;
|
||||
}
|
||||
|
||||
public function setRoot($root)
|
||||
{
|
||||
$this->root = $root;
|
||||
}
|
||||
|
||||
public function getRoot()
|
||||
{
|
||||
return $this->root;
|
||||
}
|
||||
|
||||
public function setVisitor(ValidationVisitorInterface $visitor)
|
||||
{
|
||||
$this->visitor = $visitor;
|
||||
}
|
||||
|
||||
public function getVisitor()
|
||||
{
|
||||
return $this->visitor;
|
||||
}
|
||||
|
||||
public function getValidatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
public function getMetadataFactory()
|
||||
{
|
||||
}
|
||||
}
|
Reference in a new issue