Skip to content

Commit

Permalink
Merge branch '2.3' into 2.6
Browse files Browse the repository at this point in the history
* 2.3:
  Remove some useless @group annotations
  Removed useless strtolower call
  [Validator] Use strict comparisons in loaders
  CS: Use "self" keyword instead of class name if possible
  • Loading branch information
fabpot committed Apr 8, 2015
2 parents 85d9b42 + 2f68e49 commit 8218bba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Constraint.php
Expand Up @@ -232,7 +232,7 @@ public function __get($option)
*/
public function addImplicitGroupName($group)
{
if (in_array(Constraint::DEFAULT_GROUP, $this->groups) && !in_array($group, $this->groups)) {
if (in_array(self::DEFAULT_GROUP, $this->groups) && !in_array($group, $this->groups)) {
$this->groups[] = $group;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Mapping/Loader/AnnotationLoader.php
Expand Up @@ -58,7 +58,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
}

foreach ($reflClass->getProperties() as $property) {
if ($property->getDeclaringClass()->name == $className) {
if ($property->getDeclaringClass()->name === $className) {
foreach ($this->reader->getPropertyAnnotations($property) as $constraint) {
if ($constraint instanceof Constraint) {
$metadata->addPropertyConstraint($property->name, $constraint);
Expand All @@ -70,7 +70,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
}

foreach ($reflClass->getMethods() as $method) {
if ($method->getDeclaringClass()->name == $className) {
if ($method->getDeclaringClass()->name === $className) {
foreach ($this->reader->getMethodAnnotations($method) as $constraint) {
if ($constraint instanceof Callback) {
$constraint->callback = $method->getName();
Expand Down
2 changes: 1 addition & 1 deletion Mapping/Loader/YamlFileLoader.php
Expand Up @@ -85,7 +85,7 @@ protected function parseNodes(array $nodes)
$values = array();

foreach ($nodes as $name => $childNodes) {
if (is_numeric($name) && is_array($childNodes) && count($childNodes) == 1) {
if (is_numeric($name) && is_array($childNodes) && 1 === count($childNodes)) {
$options = current($childNodes);

if (is_array($options)) {
Expand Down

0 comments on commit 8218bba

Please sign in to comment.