Skip to content

Commit daebbcf

Browse files
committed
Use strict comparison where possible
1 parent 300b306 commit daebbcf

File tree

17 files changed

+35
-50
lines changed

17 files changed

+35
-50
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ a release.
2020

2121
## [Unreleased]
2222
### Added
23-
- PHP 8 Attributes support for Doctrine MongoDB to document & traits
24-
- Support for doctrine/dbal >=3.2
23+
- PHP 8 Attributes support for Doctrine MongoDB to document & traits.
24+
- Support for doctrine/dbal >=3.2.
2525
- Timestampable: Support to use annotations as attributes on PHP >= 8.0.
2626

2727
### Changes
28-
- Dropped support for doctrine/dbal < 2.13.1
28+
- Translatable: Dropped support for other values than "true", "false", "1" and "0" in the `fallback` attribute of the XML mapping.
29+
- Tree: Dropped support for other values than "true", "false", "1" and "0" in the `activate-locking` attribute of the `tree`
30+
element in the XML mapping.
31+
Tree: Dropped support for other values than "true", "false", "1" and "0" in the `append_id`, `starts_with_separator` and
32+
`ends_with_separator` attributes of the `tree-path` element in the XML mapping.
33+
- Dropped support for doctrine/dbal < 2.13.1.
2934
- The third argument of `Gedmo\SoftDeleteable\Query\TreeWalker\Exec\MultiTableDeleteExecutor::__construct()` requires a `Doctrine\ORM\Mapping\ClassMetadata` instance.
3035

3136
## [3.3.1] - 2021-11-18

src/Blameable/Mapping/Driver/Annotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function readExtendedMetadata($meta, array &$config)
7272
if (!in_array($blameable->on, ['update', 'create', 'change'], true)) {
7373
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
7474
}
75-
if ('change' == $blameable->on) {
75+
if ('change' === $blameable->on) {
7676
if (!isset($blameable->field)) {
7777
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
7878
}

src/Blameable/Mapping/Driver/Xml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function readExtendedMetadata($meta, array &$config)
6464
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
6565
}
6666

67-
if ('change' == $this->_getAttribute($data, 'on')) {
67+
if ('change' === $this->_getAttribute($data, 'on')) {
6868
if (!$this->_isAttributeSet($data, 'field')) {
6969
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
7070
}
@@ -97,7 +97,7 @@ public function readExtendedMetadata($meta, array &$config)
9797
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
9898
}
9999

100-
if ('change' == $this->_getAttribute($data, 'on')) {
100+
if ('change' === $this->_getAttribute($data, 'on')) {
101101
if (!$this->_isAttributeSet($data, 'field')) {
102102
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
103103
}

src/Blameable/Mapping/Driver/Yaml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function readExtendedMetadata($meta, array &$config)
5959
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
6060
}
6161

62-
if ('change' == $mappingProperty['on']) {
62+
if ('change' === $mappingProperty['on']) {
6363
if (!isset($mappingProperty['field'])) {
6464
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
6565
}
@@ -90,7 +90,7 @@ public function readExtendedMetadata($meta, array &$config)
9090
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
9191
}
9292

93-
if ('change' == $mappingProperty['on']) {
93+
if ('change' === $mappingProperty['on']) {
9494
if (!isset($mappingProperty['field'])) {
9595
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
9696
}

src/IpTraceable/Mapping/Driver/Annotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function readExtendedMetadata($meta, array &$config)
6363
if (!in_array($ipTraceable->on, ['update', 'create', 'change'], true)) {
6464
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
6565
}
66-
if ('change' == $ipTraceable->on) {
66+
if ('change' === $ipTraceable->on) {
6767
if (!isset($ipTraceable->field)) {
6868
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
6969
}

src/IpTraceable/Mapping/Driver/Xml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function readExtendedMetadata($meta, array &$config)
6464
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
6565
}
6666

67-
if ('change' == $this->_getAttribute($data, 'on')) {
67+
if ('change' === $this->_getAttribute($data, 'on')) {
6868
if (!$this->_isAttributeSet($data, 'field')) {
6969
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
7070
}
@@ -101,7 +101,7 @@ public function readExtendedMetadata($meta, array &$config)
101101
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
102102
}
103103

104-
if ('change' == $this->_getAttribute($data, 'on')) {
104+
if ('change' === $this->_getAttribute($data, 'on')) {
105105
if (!$this->_isAttributeSet($data, 'field')) {
106106
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
107107
}

src/IpTraceable/Mapping/Driver/Yaml.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function readExtendedMetadata($meta, array &$config)
5757
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
5858
}
5959

60-
if ('change' == $mappingProperty['on']) {
60+
if ('change' === $mappingProperty['on']) {
6161
if (!isset($mappingProperty['field'])) {
6262
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
6363
}
@@ -88,7 +88,7 @@ public function readExtendedMetadata($meta, array &$config)
8888
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
8989
}
9090

91-
if ('change' == $mappingProperty['on']) {
91+
if ('change' === $mappingProperty['on']) {
9292
if (!isset($mappingProperty['field'])) {
9393
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
9494
}

src/Loggable/Mapping/Driver/Xml.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function readExtendedMetadata($meta, array &$config)
3838

3939
$xml = $xml->children(self::GEDMO_NAMESPACE_URI);
4040

41-
if ('entity' == $xmlDoctrine->getName() || 'document' == $xmlDoctrine->getName() || 'mapped-superclass' == $xmlDoctrine->getName()) {
41+
if ('entity' === $xmlDoctrine->getName() || 'document' === $xmlDoctrine->getName() || 'mapped-superclass' === $xmlDoctrine->getName()) {
4242
if (isset($xml->loggable)) {
4343
/**
4444
* @var \SimpleXMLElement;

src/Mapping/ExtensionMetadataFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function getDriver($omDriver)
154154
$driver = null;
155155
$className = get_class($omDriver);
156156
$driverName = substr($className, strrpos($className, '\\') + 1);
157-
if ($omDriver instanceof MappingDriverChain || 'DriverChain' == $driverName) {
157+
if ($omDriver instanceof MappingDriverChain || 'DriverChain' === $driverName) {
158158
$driver = new Driver\Chain();
159159
foreach ($omDriver->getDrivers() as $namespace => $nestedOmDriver) {
160160
$driver->addDriver($this->getDriver($nestedOmDriver), $namespace);

src/Timestampable/Mapping/Driver/Annotation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function readExtendedMetadata($meta, array &$config)
7272
if (!in_array($timestampable->on, ['update', 'create', 'change'], true)) {
7373
throw new InvalidMappingException("Field - [{$field}] trigger 'on' is not one of [update, create, change] in class - {$meta->getName()}");
7474
}
75-
if ('change' == $timestampable->on) {
75+
if ('change' === $timestampable->on) {
7676
if (!isset($timestampable->field)) {
7777
throw new InvalidMappingException("Missing parameters on property - {$field}, field must be set on [change] trigger in class - {$meta->getName()}");
7878
}

0 commit comments

Comments
 (0)