Skip to content
Browse files

fixed CS

  • Loading branch information...
1 parent bdf64a1 commit b92e1e62e874eb47d3d64a93017eda64091ddce2 @fabpot fabpot committed Dec 18, 2011
View
2 Constraint.php
@@ -100,7 +100,7 @@ public function __construct($options = null)
$invalidOptions[] = $option;
}
}
- } else if (null !== $options && ! (is_array($options) && count($options) === 0)) {
+ } elseif (null !== $options && ! (is_array($options) && count($options) === 0)) {
$option = $this->getDefaultOption();
if (null === $option) {
View
2 Constraints/ChoiceValidator.php
@@ -54,7 +54,7 @@ public function isValid($value, Constraint $constraint)
if ($constraint->callback) {
if (is_callable(array($this->context->getCurrentClass(), $constraint->callback))) {
$choices = call_user_func(array($this->context->getCurrentClass(), $constraint->callback));
- } else if (is_callable($constraint->callback)) {
+ } elseif (is_callable($constraint->callback)) {
$choices = call_user_func($constraint->callback);
} else {
throw new ConstraintDefinitionException('The Choice constraint expects a valid callback');
View
4 Constraints/FileValidator.php
@@ -81,11 +81,11 @@ public function isValid($value, Constraint $constraint)
$size = filesize($path);
$limit = $constraint->maxSize;
$suffix = ' bytes';
- } else if (preg_match('/^(\d+)k$/', $constraint->maxSize, $matches)) {
+ } elseif (preg_match('/^(\d+)k$/', $constraint->maxSize, $matches)) {
$size = round(filesize($path) / 1000, 2);
$limit = $matches[1];
$suffix = ' kB';
- } else if (preg_match('/^(\d+)M$/', $constraint->maxSize, $matches)) {
+ } elseif (preg_match('/^(\d+)M$/', $constraint->maxSize, $matches)) {
$size = round(filesize($path) / 1000000, 2);
$limit = $matches[1];
$suffix = ' MB';
View
2 Constraints/TypeValidator.php
@@ -40,7 +40,7 @@ public function isValid($value, Constraint $constraint)
if (function_exists($function) && call_user_func($function, $value)) {
return true;
- } else if ($value instanceof $constraint->type) {
+ } elseif ($value instanceof $constraint->type) {
return true;
}
View
2 Mapping/ClassMetadata.php
@@ -186,7 +186,7 @@ public function mergeConstraints(ClassMetadata $source)
if ($member instanceof PropertyMetadata && !isset($this->properties[$property])) {
$this->properties[$property] = $member;
- } else if ($member instanceof GetterMetadata && !isset($this->getters[$property])) {
+ } elseif ($member instanceof GetterMetadata && !isset($this->getters[$property])) {
$this->getters[$property] = $member;
}
}
View
2 Mapping/GetterMetadata.php
@@ -28,7 +28,7 @@ public function __construct($class, $property)
if (method_exists($class, $getMethod)) {
$method = $getMethod;
- } else if (method_exists($class, $isMethod)) {
+ } elseif (method_exists($class, $isMethod)) {
$method = $isMethod;
} else {
throw new ValidatorException(sprintf('Neither method %s nor %s exists in class %s', $getMethod, $isMethod, $class));
View
2 Mapping/Loader/FileLoader.php
@@ -58,7 +58,7 @@ protected function newConstraint($name, $options)
{
if (strpos($name, '\\') !== false && class_exists($name)) {
$className = (string) $name;
- } else if (strpos($name, ':') !== false) {
+ } elseif (strpos($name, ':') !== false) {
list($prefix, $className) = explode(':', $name, 2);
if (!isset($this->namespaces[$prefix])) {
View
10 Mapping/Loader/XmlFileLoader.php
@@ -80,14 +80,14 @@ protected function parseConstraints(\SimpleXMLElement $nodes)
if (count($node) > 0) {
if (count($node->value) > 0) {
$options = $this->parseValues($node->value);
- } else if (count($node->constraint) > 0) {
+ } elseif (count($node->constraint) > 0) {
$options = $this->parseConstraints($node->constraint);
- } else if (count($node->option) > 0) {
+ } elseif (count($node->option) > 0) {
$options = $this->parseOptions($node->option);
} else {
$options = array();
}
- } else if (strlen((string) $node) > 0) {
+ } elseif (strlen((string) $node) > 0) {
$options = trim($node);
} else {
$options = null;
@@ -114,7 +114,7 @@ protected function parseValues(\SimpleXMLElement $nodes)
if (count($node) > 0) {
if (count($node->value) > 0) {
$value = $this->parseValues($node->value);
- } else if (count($node->constraint) > 0) {
+ } elseif (count($node->constraint) > 0) {
$value = $this->parseConstraints($node->constraint);
} else {
$value = array();
@@ -148,7 +148,7 @@ protected function parseOptions(\SimpleXMLElement $nodes)
if (count($node) > 0) {
if (count($node->value) > 0) {
$value = $this->parseValues($node->value);
- } else if (count($node->constraint) > 0) {
+ } elseif (count($node->constraint) > 0) {
$value = $this->parseConstraints($node->constraint);
} else {
$value = array();
View
4 ValidatorFactory.php
@@ -110,7 +110,7 @@ static public function buildDefault(array $mappingFiles = array(), $annotations
if ($extension === 'xml') {
$xmlMappingFiles[] = $file;
- } else if ($extension === 'yaml' || $extension === 'yml') {
+ } elseif ($extension === 'yaml' || $extension === 'yml') {
$yamlMappingFiles[] = $file;
} else {
throw new MappingException('The only supported mapping file formats are XML and YAML');
@@ -135,7 +135,7 @@ static public function buildDefault(array $mappingFiles = array(), $annotations
if (count($loaders) > 1) {
$loader = new LoaderChain($loaders);
- } else if (count($loaders) === 1) {
+ } elseif (count($loaders) === 1) {
$loader = $loaders[0];
} else {
throw new MappingException('No mapping loader was found for the given parameters');

0 comments on commit b92e1e6

Please sign in to comment.
Something went wrong with that request. Please try again.