Skip to content

Commit

Permalink
#14203 - Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aziz Muzafarov committed Nov 4, 2021
1 parent 4c3b140 commit d6fd0a5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions phalcon/Validation.zep
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,17 @@ class Validation extends Injectable implements ValidationInterface

if method_exists(entity, method) {
return entity->{method}();
} elseif method_exists(entity, "readAttribute") {
}

if method_exists(entity, "readAttribute") {
return entity->readAttribute(field);
} elseif isset entity->{field} {
}

if isset entity->{field} {
return entity->{field};
} else {
return null;
}

return null;
}

private function getValueByData(data, string field) -> var | null
Expand All @@ -270,7 +274,9 @@ class Validation extends Injectable implements ValidationInterface
if isset data[field] {
return data[field];
}
} elseif typeof data == "object" {
}

if typeof data == "object" {
if isset data->{field} {
return data->{field};
}
Expand Down

0 comments on commit d6fd0a5

Please sign in to comment.