From 1bc51a1c3949260e488b88fc2dd1fcf38b14bf39 Mon Sep 17 00:00:00 2001 From: Joe Chenevey Date: Tue, 8 Jan 2019 15:28:15 -0500 Subject: [PATCH] Update Object.php Switch to an early `continue` rather than wrapping contents of `foreach` in an `if` and indenting. --- core/Object.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/Object.php b/core/Object.php index 7cc0181a2..21a741511 100644 --- a/core/Object.php +++ b/core/Object.php @@ -908,12 +908,14 @@ abstract class SS_Object { $methods = $this->findMethodsFromExtension($extension); if ($methods) { foreach ($methods as $method) { - if (isset(self::$extra_methods[$this->class][$method])) { - $methodInfo = self::$extra_methods[$this->class][$method]; + if (!isset(self::$extra_methods[$this->class][$method])) { + continue; + } + + $methodInfo = self::$extra_methods[$this->class][$method]; - if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) { - unset(self::$extra_methods[$this->class][$method]); - } + if ($methodInfo['property'] === $property && $methodInfo['index'] === $index) { + unset(self::$extra_methods[$this->class][$method]); } }