Commit a21acb3b authored by catch's avatar catch

Issue #2278353 by cilefen, dawehner, hussainweb, jibran, andyceo: Update to Symfony 2.5.

parent 0189add1
This diff is collapsed.
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
use Drupal\Core\TypedData\Validation\MetadataFactory; use Drupal\Core\TypedData\Validation\MetadataFactory;
use Drupal\Core\Validation\ConstraintManager; use Drupal\Core\Validation\ConstraintManager;
use Drupal\Core\Validation\DrupalTranslator; use Drupal\Core\Validation\DrupalTranslator;
use Symfony\Component\Validator\ValidatorInterface;
use Symfony\Component\Validator\Validation; use Symfony\Component\Validator\Validation;
use Symfony\Component\Validator\Validator\ValidatorInterface;
/** /**
* Manages data type plugins. * Manages data type plugins.
...@@ -298,7 +298,7 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, ...@@ -298,7 +298,7 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name,
/** /**
* Sets the validator for validating typed data. * Sets the validator for validating typed data.
* *
* @param \Symfony\Component\Validator\ValidatorInterface $validator * @param \Symfony\Component\Validator\Validator\ValidatorInterface $validator
* The validator object to set. * The validator object to set.
*/ */
public function setValidator(ValidatorInterface $validator) { public function setValidator(ValidatorInterface $validator) {
...@@ -308,7 +308,7 @@ public function setValidator(ValidatorInterface $validator) { ...@@ -308,7 +308,7 @@ public function setValidator(ValidatorInterface $validator) {
/** /**
* Gets the validator for validating typed data. * Gets the validator for validating typed data.
* *
* @return \Symfony\Component\Validator\ValidatorInterface * @return \Symfony\Component\Validator\Validator\ValidatorInterface
* The validator object. * The validator object.
*/ */
public function getValidator() { public function getValidator() {
...@@ -316,6 +316,7 @@ public function getValidator() { ...@@ -316,6 +316,7 @@ public function getValidator() {
$this->validator = Validation::createValidatorBuilder() $this->validator = Validation::createValidatorBuilder()
->setMetadataFactory(new MetadataFactory()) ->setMetadataFactory(new MetadataFactory())
->setTranslator(new DrupalTranslator()) ->setTranslator(new DrupalTranslator())
->setApiVersion(Validation::API_VERSION_2_4)
->getValidator(); ->getValidator();
} }
return $this->validator; return $this->validator;
......
...@@ -101,7 +101,7 @@ public function registerDefinitions() { ...@@ -101,7 +101,7 @@ public function registerDefinitions() {
)); ));
$this->discovery->setDefinition('Email', array( $this->discovery->setDefinition('Email', array(
'label' => new TranslationWrapper('Email'), 'label' => new TranslationWrapper('Email'),
'class' => '\Symfony\Component\Validator\Constraints\Email', 'class' => '\Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint',
'type' => array('string'), 'type' => array('string'),
)); ));
} }
......
<?php
/**
* @file
* Contains \Drupal\Core\Validation\Plugin\Validation\Constraint\EmailConstraint.
*/
namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
use Symfony\Component\Validator\Constraints\Email;
/**
* Count constraint.
*
* Overrides the symfony constraint to use the strict setting.
*
* @Plugin(
* id = "Email",
* label = @Translation("Email", context = "Validation")
* )
*/
class EmailConstraint extends Email {
public $strict = TRUE;
/**
* {@inheritdoc}
*/
public function validatedBy() {
return '\Symfony\Component\Validator\Constraints\EmailValidator';
}
}
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'), 'Symfony\\Component\\Serializer\\' => array($vendorDir . '/symfony/serializer'),
'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'), 'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),
'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'),
'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'), 'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3. * ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3.
* *
* It expects an object implementing a findFile method to find the file. This * It expects an object implementing a findFile method to find the file. This
* allow using it as a wrapper around the other loaders of the component (the * allows using it as a wrapper around the other loaders of the component (the
* ClassLoader and the UniversalClassLoader for instance) but also around any * ClassLoader and the UniversalClassLoader for instance) but also around any
* other autoloader following this convention (the Composer one for instance) * other autoloader following this convention (the Composer one for instance)
* *
...@@ -46,7 +46,7 @@ class ApcClassLoader ...@@ -46,7 +46,7 @@ class ApcClassLoader
/** /**
* The class loader object being decorated. * The class loader object being decorated.
* *
* @var \Symfony\Component\ClassLoader\ClassLoader * @var object
* A class loader object that implements the findFile() method. * A class loader object that implements the findFile() method.
*/ */
protected $decorated; protected $decorated;
...@@ -79,7 +79,7 @@ public function __construct($prefix, $decorated) ...@@ -79,7 +79,7 @@ public function __construct($prefix, $decorated)
/** /**
* Registers this instance as an autoloader. * Registers this instance as an autoloader.
* *
* @param Boolean $prepend Whether to prepend the autoloader or not * @param bool $prepend Whether to prepend the autoloader or not
*/ */
public function register($prepend = false) public function register($prepend = false)
{ {
...@@ -99,7 +99,7 @@ public function unregister() ...@@ -99,7 +99,7 @@ public function unregister()
* *
* @param string $class The name of the class * @param string $class The name of the class
* *
* @return Boolean|null True, if loaded * @return bool|null True, if loaded
*/ */
public function loadClass($class) public function loadClass($class)
{ {
...@@ -133,5 +133,4 @@ public function __call($method, $args) ...@@ -133,5 +133,4 @@ public function __call($method, $args)
{ {
return call_user_func_array(array($this->decorated, $method), $args); return call_user_func_array(array($this->decorated, $method), $args);
} }
} }
...@@ -28,8 +28,8 @@ class ClassCollectionLoader ...@@ -28,8 +28,8 @@ class ClassCollectionLoader
* @param array $classes An array of classes to load * @param array $classes An array of classes to load
* @param string $cacheDir A cache directory * @param string $cacheDir A cache directory
* @param string $name The cache name prefix * @param string $name The cache name prefix
* @param Boolean $autoReload Whether to flush the cache when the cache is stale or not * @param bool $autoReload Whether to flush the cache when the cache is stale or not
* @param Boolean $adaptive Whether to remove already declared classes or not * @param bool $adaptive Whether to remove already declared classes or not
* @param string $extension File extension of the resulting file * @param string $extension File extension of the resulting file
* *
* @throws \InvalidArgumentException When class can't be loaded * @throws \InvalidArgumentException When class can't be loaded
...@@ -200,7 +200,7 @@ public static function fixNamespaceDeclarations($source) ...@@ -200,7 +200,7 @@ public static function fixNamespaceDeclarations($source)
*/ */
public static function enableTokenizer($bool) public static function enableTokenizer($bool)
{ {
self::$useTokenizer = (Boolean) $bool; self::$useTokenizer = (bool) $bool;
} }
/** /**
......
...@@ -103,7 +103,7 @@ public function addPrefix($prefix, $paths) ...@@ -103,7 +103,7 @@ public function addPrefix($prefix, $paths)
/** /**
* Turns on searching the include for class files. * Turns on searching the include for class files.
* *