Development

Changeset 32425

You must first sign up to be able to contribute.

Changeset 32425

Show
Ignore:
Timestamp:
03/31/11 15:15:08 (4 years ago)
Author:
fabien
Message:

Merge branch 'master' of git://github.com/symfony/symfony

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.0/src/Symfony/Component/Validator/Constraint.php

    r32423 r32425  
    8282    { 
    8383        $invalidOptions = array(); 
    84         $missingOptions = array_flip((array)$this->getRequiredOptions()); 
     84        $missingOptions = array_flip((array) $this->getRequiredOptions()); 
    8585 
    8686        if (is_array($options) && count($options) == 1 && isset($options['value'])) { 
     
    128128        } 
    129129 
    130         $this->groups = (array)$this->groups; 
     130        $this->groups = (array) $this->groups; 
    131131    } 
    132132 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/CountryValidator.php

    r32184 r32425  
    3333        } 
    3434 
    35         $value = (string)$value; 
     35        $value = (string) $value; 
    3636 
    3737        if (!in_array($value, \Symfony\Component\Locale\Locale::getCountries())) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/DateTimeValidator.php

    r32184 r32425  
    3434        } 
    3535 
    36         $value = (string)$value; 
     36        $value = (string) $value; 
    3737 
    3838        if (!preg_match(self::PATTERN, $value, $matches)) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/DateValidator.php

    r32184 r32425  
    3030        } 
    3131 
    32         $value = (string)$value; 
     32        $value = (string) $value; 
    3333 
    3434        if (!preg_match(self::PATTERN, $value, $matches)) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/EmailValidator.php

    r32258 r32425  
    2929        } 
    3030 
    31         $value = (string)$value; 
     31        $value = (string) $value; 
    3232 
    3333        if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/FileValidator.php

    r32184 r32425  
    3434        } 
    3535 
    36         $path = $value instanceof FileObject ? $value->getPath() : (string)$value; 
     36        $path = $value instanceof FileObject ? $value->getPath() : (string) $value; 
    3737 
    3838        if (!file_exists($path)) { 
     
    4949 
    5050        if ($constraint->maxSize) { 
    51             if (ctype_digit((string)$constraint->maxSize)) { 
     51            if (ctype_digit((string) $constraint->maxSize)) { 
    5252                $size = filesize($path); 
    5353                $limit = $constraint->maxSize; 
     
    8181            } 
    8282 
    83             if (!in_array($value->getMimeType(), (array)$constraint->mimeTypes)) { 
     83            if (!in_array($value->getMimeType(), (array) $constraint->mimeTypes)) { 
    8484                $this->setMessage($constraint->mimeTypesMessage, array( 
    8585                    '{{ type }}' => '"'.$value->getMimeType().'"', 
    86                     '{{ types }}' => '"'.implode('", "', (array)$constraint->mimeTypes).'"', 
     86                    '{{ types }}' => '"'.implode('", "', (array) $constraint->mimeTypes).'"', 
    8787                    '{{ file }}' => $path, 
    8888                )); 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/IpValidator.php

    r32184 r32425  
    3636        } 
    3737 
    38         $value = (string)$value; 
     38        $value = (string) $value; 
    3939        $valid = false; 
    4040 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/LanguageValidator.php

    r32184 r32425  
    3333        } 
    3434 
    35         $value = (string)$value; 
     35        $value = (string) $value; 
    3636 
    3737        if (!in_array($value, \Symfony\Component\Locale\Locale::getLanguages())) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/LocaleValidator.php

    r32184 r32425  
    3333        } 
    3434 
    35         $value = (string)$value; 
     35        $value = (string) $value; 
    3636 
    3737        if (!in_array($value, \Symfony\Component\Locale\Locale::getLocales())) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/MaxLengthValidator.php

    r32184 r32425  
    2828        } 
    2929 
    30         $value = (string)$value; 
     30        $value = (string) $value; 
    3131 
    3232        $length = function_exists('mb_strlen') ? mb_strlen($value, $constraint->charset) : strlen($value); 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/MinLengthValidator.php

    r32184 r32425  
    2828        } 
    2929 
    30         $value = (string)$value; 
     30        $value = (string) $value; 
    3131 
    3232        $length = function_exists('mb_strlen') ? mb_strlen($value, $constraint->charset) : strlen($value); 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/RegexValidator.php

    r32184 r32425  
    2828        } 
    2929 
    30         $value = (string)$value; 
     30        $value = (string) $value; 
    3131 
    3232        if ( 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/TimeValidator.php

    r32184 r32425  
    3030        } 
    3131 
    32         $value = (string)$value; 
     32        $value = (string) $value; 
    3333 
    3434        if (!preg_match(self::PATTERN, $value)) { 
  • branches/2.0/src/Symfony/Component/Validator/Constraints/UrlValidator.php

    r32184 r32425  
    3939        } 
    4040 
    41         $value = (string)$value; 
     41        $value = (string) $value; 
    4242 
    4343        $pattern = sprintf(self::PATTERN, implode('|', $constraint->protocols)); 
  • branches/2.0/src/Symfony/Component/Validator/Mapping/ClassMetadata.php

    r32423 r32425  
    9797    public function addConstraint(Constraint $constraint) 
    9898    { 
    99         if (!in_array(Constraint::CLASS_CONSTRAINT, (array)$constraint->getTargets())) { 
     99        if (!in_array(Constraint::CLASS_CONSTRAINT, (array) $constraint->getTargets())) { 
    100100            throw new ConstraintDefinitionException(sprintf( 
    101101                'The constraint %s cannot be put on classes', 
  • branches/2.0/src/Symfony/Component/Validator/Mapping/Loader/FileLoader.php

    r32184 r32425  
    5151    { 
    5252        if (strpos($name, '\\') !== false && class_exists($name)) { 
    53             $className = (string)$name; 
     53            $className = (string) $name; 
    5454        } else if (strpos($name, ':') !== false) { 
    5555            list($prefix, $className) = explode(':', $name); 
  • branches/2.0/src/Symfony/Component/Validator/Mapping/Loader/XmlFileLoader.php

    r32184 r32425  
    3333 
    3434            foreach ($xml->namespace as $namespace) { 
    35                 $this->namespaces[(string)$namespace['prefix']] = trim((string)$namespace); 
     35                $this->namespaces[(string) $namespace['prefix']] = trim((string) $namespace); 
    3636            } 
    3737 
    3838            foreach ($xml->class as $class) { 
    39                 $this->classes[(string)$class['name']] = $class; 
     39                $this->classes[(string) $class['name']] = $class; 
    4040            } 
    4141        } 
     
    5050            foreach ($xml->property as $property) { 
    5151                foreach ($this->parseConstraints($property->constraint) as $constraint) { 
    52                     $metadata->addPropertyConstraint((string)$property['name'], $constraint); 
     52                    $metadata->addPropertyConstraint((string) $property['name'], $constraint); 
    5353                } 
    5454            } 
     
    5656            foreach ($xml->getter as $getter) { 
    5757                foreach ($this->parseConstraints($getter->constraint) as $constraint) { 
    58                     $metadata->addGetterConstraint((string)$getter['property'], $constraint); 
     58                    $metadata->addGetterConstraint((string) $getter['property'], $constraint); 
    5959                } 
    6060            } 
     
    8888                    $options = array(); 
    8989                } 
    90             } else if (strlen((string)$node) > 0) { 
     90            } else if (strlen((string) $node) > 0) { 
    9191                $options = trim($node); 
    9292            } else { 
     
    125125 
    126126            if (isset($node['key'])) { 
    127                 $values[(string)$node['key']] = $value; 
     127                $values[(string) $node['key']] = $value; 
    128128            } else { 
    129129                $values[] = $value; 
     
    158158            } 
    159159 
    160             $options[(string)$node['name']] = $value; 
     160            $options[(string) $node['name']] = $value; 
    161161        } 
    162162 
  • branches/2.0/src/Symfony/Component/Validator/Mapping/MemberMetadata.php

    r32423 r32425  
    4545    public function addConstraint(Constraint $constraint) 
    4646    { 
    47         if (!in_array(Constraint::PROPERTY_CONSTRAINT, (array)$constraint->getTargets())) { 
     47        if (!in_array(Constraint::PROPERTY_CONSTRAINT, (array) $constraint->getTargets())) { 
    4848            throw new ConstraintDefinitionException(sprintf( 
    4949                'The constraint %s cannot be put on properties or getters', 
  • branches/2.0/src/Symfony/Component/Validator/Validator.php

    r32184 r32425  
    9696    { 
    9797        $walker = new GraphWalker($root, $this->metadataFactory, $this->validatorFactory); 
    98         $groups = $groups ? (array)$groups : array(Constraint::DEFAULT_GROUP); 
     98        $groups = $groups ? (array) $groups : array(Constraint::DEFAULT_GROUP); 
    9999 
    100100        foreach ($groups as $group) {