Skip to content

Commit

Permalink
There is no need to type check for booleans in if statements when the…
Browse files Browse the repository at this point in the history
… return values are already a boolean.
  • Loading branch information
JoshuaLuckers committed Jul 6, 2018
1 parent 4fd4840 commit aa1d565
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Datasource/EntityTrait.php
Expand Up @@ -899,7 +899,7 @@ public function isNew($new = null)
*/
public function hasErrors($includeNested = true)
{
if (empty($this->_errors) === false) {
if (!empty($this->_errors)) {
return true;
}

Expand All @@ -908,7 +908,7 @@ public function hasErrors($includeNested = true)
}

foreach ($this->_properties as $property) {
if ($this->_readHasErrors($property) === true) {
if ($this->_readHasErrors($property)) {
return true;
}
}
Expand Down Expand Up @@ -1123,13 +1123,13 @@ protected function _nestedErrors($field)
*/
protected function _readHasErrors($object)
{
if ($object instanceof EntityInterface && $object->hasErrors() === true) {
if ($object instanceof EntityInterface && $object->hasErrors()) {
return true;
}

if (is_array($object) === true) {
if (is_array($object)) {
foreach ($object as $value) {
if ($this->_readHasErrors($value) === true) {
if ($this->_readHasErrors($value)) {
return true;
}
}
Expand Down

0 comments on commit aa1d565

Please sign in to comment.