From d6fd0a5adb8c70632ad03d3ae1ec733211b4c021 Mon Sep 17 00:00:00 2001 From: Aziz Muzafarov Date: Wed, 3 Nov 2021 12:38:53 +0300 Subject: [PATCH] #14203 - Review fixes --- phalcon/Validation.zep | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/phalcon/Validation.zep b/phalcon/Validation.zep index 4c7a1574266..5285fd4b00c 100644 --- a/phalcon/Validation.zep +++ b/phalcon/Validation.zep @@ -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 @@ -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}; }