Permalink
Browse files

fixed CS

  • Loading branch information...
1 parent e2c39f4 commit 2d02293c193be5e93019fe7961922a7ce05cddb0 @fabpot fabpot committed Jul 9, 2012
@@ -27,5 +27,5 @@
*
* @return ConstraintValidatorInterface
*/
- function getInstance(Constraint $constraint);
+ public function getInstance(Constraint $constraint);
}
@@ -23,7 +23,7 @@
*
* @param ExecutionContext $context The current validation context
*/
- function initialize(ExecutionContext $context);
+ public function initialize(ExecutionContext $context);
/**
* Checks if the passed value is valid.
@@ -33,5 +33,5 @@ function initialize(ExecutionContext $context);
*
* @api
*/
- function validate($value, Constraint $constraint);
+ public function validate($value, Constraint $constraint);
}
View
@@ -44,7 +44,7 @@ class Ip extends Constraint
const V6_ONLY_PUBLIC = '6_public';
const ALL_ONLY_PUBLIC = 'all_public';
- static protected $versions = array(
+ protected static $versions = array(
self::V4,
self::V6,
self::ALL,
View
@@ -12,7 +12,6 @@
namespace Symfony\Component\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
-use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
/**
* @Annotation
@@ -78,6 +77,7 @@ private function getNonDelimitedPattern()
// Unescape the delimiter in pattern
$pattern = str_replace('\\' . $delimiter, $delimiter, $pattern);
+
return $start . $pattern . $end;
}
@@ -22,5 +22,5 @@
*
* @return array An array of validation groups
*/
- function getGroupSequence();
+ public function getGroupSequence();
}
@@ -25,7 +25,7 @@
*
* @param string $class
*/
- function has($class);
+ public function has($class);
/**
* Returns the metadata for the given class from the cache
@@ -34,12 +34,12 @@ function has($class);
*
* @return ClassMetadata|false A ClassMetadata instance or false on miss
*/
- function read($class);
+ public function read($class);
/**
* Stores a class metadata in the cache
*
* @param ClassMetadata $metadata A Class Metadata
*/
- function write(ClassMetadata $metadata);
+ public function write(ClassMetadata $metadata);
}
@@ -13,5 +13,5 @@
interface ClassMetadataFactoryInterface
{
- function getClassMetadata($class);
+ public function getClassMetadata($class);
}
@@ -22,5 +22,5 @@
*
* @return Boolean
*/
- function loadClassMetadata(ClassMetadata $metadata);
+ public function loadClassMetadata(ClassMetadata $metadata);
}
@@ -55,7 +55,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
$yaml = $this->classes[$metadata->getClassName()];
if (isset($yaml['group_sequence_provider'])) {
- $metadata->setGroupSequenceProvider((bool)$yaml['group_sequence_provider']);
+ $metadata->setGroupSequenceProvider((bool) $yaml['group_sequence_provider']);
}
if (isset($yaml['constraints']) && is_array($yaml['constraints'])) {
@@ -30,5 +30,5 @@
*
* @api
*/
- function initialize($object);
+ public function initialize($object);
}
@@ -11,7 +11,6 @@
namespace Symfony\Component\Validator\Tests\Constraints;
-
use Symfony\Component\Validator\ExecutionContext;
use Symfony\Component\Validator\Constraints\Min;
use Symfony\Component\Validator\Constraints\Max;
@@ -57,7 +56,6 @@ public function testNullIsValid()
$this->validator->validate(null, new All(new Min(4)));
}
-
/**
* @expectedException Symfony\Component\Validator\Exception\UnexpectedTypeException
*/
@@ -112,7 +112,6 @@ public function testCallbackMultipleMethods()
'{{ value }}' => 'baz',
));
-
$this->validator->validate($object, new Callback(array(
'validateOne', 'validateTwo'
)));
@@ -11,7 +11,6 @@
namespace Symfony\Component\Validator\Tests\Constraints;
-
use Symfony\Component\Validator\ExecutionContext;
use Symfony\Component\Validator\Constraints\Choice;
use Symfony\Component\Validator\Constraints\ChoiceValidator;
@@ -11,7 +11,6 @@
namespace Symfony\Component\Validator\Tests\Constraints;
-
use Symfony\Component\Validator\ExecutionContext;
use Symfony\Component\Validator\Constraints\Min;
use Symfony\Component\Validator\Constraints\NotNull;
@@ -106,4 +106,3 @@ public function testEmptyArrayIsInvalid()
$this->validator->validate(array(), $constraint);
}
}
-
@@ -17,7 +17,7 @@
class ConstraintAValidator extends ConstraintValidator
{
- static public $passedContext;
+ public static $passedContext;
public function initialize(ExecutionContext $context)
{
@@ -36,4 +36,3 @@ public function testGetValueFromPublicGetter()
$this->assertEquals('foobar from getter', $metadata->getValue($entity));
}
}
-
@@ -82,4 +82,3 @@ public function testReturnsFalseIfNoLoaderReturnedTrue()
$this->assertFalse($chain->loadClassMetadata($metadata));
}
}
-
@@ -59,7 +59,7 @@ public function testLoadClassMetadataDoesNotRepeatLoadWithParentClasses()
class StaticLoaderEntity
{
- static public $invokedWith = null;
+ public static $invokedWith = null;
public static function loadMetadata(ClassMetadata $metadata)
{
@@ -73,7 +73,7 @@ class StaticLoaderDocument extends BaseStaticLoaderDocument
class BaseStaticLoaderDocument
{
- static public function loadMetadata(ClassMetadata $metadata)
+ public static function loadMetadata(ClassMetadata $metadata)
{
$metadata->addConstraint(new ConstraintA());
}
@@ -33,4 +33,3 @@ public function testGetValueFromPrivateProperty()
$this->assertEquals('foobar', $metadata->getValue($entity));
}
}
-
@@ -35,19 +35,19 @@
*
* @param ClassMetadataFactoryInterface $classMetadataFactory The factory instance
*/
- function setClassMetadataFactory(ClassMetadataFactoryInterface $classMetadataFactory);
+ public function setClassMetadataFactory(ClassMetadataFactoryInterface $classMetadataFactory);
/**
* Sets the constraint validator factory used in the new validator
*
* @param ConstraintValidatorFactoryInterface $constraintValidatorFactory The factory instance
*/
- function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $constraintValidatorFactory);
+ public function setConstraintValidatorFactory(ConstraintValidatorFactoryInterface $constraintValidatorFactory);
/**
* Creates a new validator with the settings stored in this context
*
* @return ValidatorInterface The new validator
*/
- function getValidator();
+ public function getValidator();
}
View
@@ -98,7 +98,7 @@ class ValidatorFactory implements ValidatorContextInterface
* has neither the extension ".xml" nor
* ".yml" nor ".yaml"
*/
- static public function buildDefault(array $mappingFiles = array(), $annotations = false, $staticMethod = null)
+ public static function buildDefault(array $mappingFiles = array(), $annotations = false, $staticMethod = null)
{
$xmlMappingFiles = array();
$yamlMappingFiles = array();
View
@@ -32,7 +32,7 @@
*
* @api
*/
- function validate($object, $groups = null);
+ public function validate($object, $groups = null);
/**
* Validate a single property of an object against its current value.
@@ -45,7 +45,7 @@ function validate($object, $groups = null);
*
* @api
*/
- function validateProperty($object, $property, $groups = null);
+ public function validateProperty($object, $property, $groups = null);
/**
* Validate a single property of an object against the given value.
@@ -59,7 +59,7 @@ function validateProperty($object, $property, $groups = null);
*
* @api
*/
- function validatePropertyValue($class, $property, $value, $groups = null);
+ public function validatePropertyValue($class, $property, $value, $groups = null);
/**
* Validates a given value against a specific Constraint.
@@ -72,7 +72,7 @@ function validatePropertyValue($class, $property, $value, $groups = null);
*
* @api
*/
- function validateValue($value, Constraint $constraint, $groups = null);
+ public function validateValue($value, Constraint $constraint, $groups = null);
/**
* Returns the factory for ClassMetadata instances
@@ -81,5 +81,5 @@ function validateValue($value, Constraint $constraint, $groups = null);
*
* @api
*/
- function getMetadataFactory();
+ public function getMetadataFactory();
}

0 comments on commit 2d02293

Please sign in to comment.