Skip to content

Commit efc1c03

Browse files
committed
[Validator] Use strict comparisons in loaders
1 parent 36d62ee commit efc1c03

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Symfony/Component/Validator/Mapping/Loader/AnnotationLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
5757
}
5858

5959
foreach ($reflClass->getProperties() as $property) {
60-
if ($property->getDeclaringClass()->name == $className) {
60+
if ($property->getDeclaringClass()->name === $className) {
6161
foreach ($this->reader->getPropertyAnnotations($property) as $constraint) {
6262
if ($constraint instanceof Constraint) {
6363
$metadata->addPropertyConstraint($property->name, $constraint);
@@ -69,7 +69,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
6969
}
7070

7171
foreach ($reflClass->getMethods() as $method) {
72-
if ($method->getDeclaringClass()->name == $className) {
72+
if ($method->getDeclaringClass()->name === $className) {
7373
foreach ($this->reader->getMethodAnnotations($method) as $constraint) {
7474
if ($constraint instanceof Constraint) {
7575
if (preg_match('/^(get|is)(.+)$/i', $method->name, $matches)) {

src/Symfony/Component/Validator/Mapping/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function parseNodes(array $nodes)
8585
$values = array();
8686

8787
foreach ($nodes as $name => $childNodes) {
88-
if (is_numeric($name) && is_array($childNodes) && count($childNodes) == 1) {
88+
if (is_numeric($name) && is_array($childNodes) && 1 === count($childNodes)) {
8989
$options = current($childNodes);
9090

9191
if (is_array($options)) {

0 commit comments

Comments
 (0)