diff --git a/src/Tags.php b/src/Tags.php index 6684ec05..1a327428 100644 --- a/src/Tags.php +++ b/src/Tags.php @@ -121,12 +121,17 @@ public static function modelsFor(array $targets) return collect($models)->collapse()->unique(); } + /** + * Get the value of the given ReflectionProperty. + * + * @param \ReflectionProperty $property + * @param mixed $target + */ protected static function getValue(ReflectionProperty $property, $target) { - if (method_exists($property, 'isInitialized')) { - if (! $property->isInitialized($target)) { - return; - } + if (method_exists($property, 'isInitialized') && + ! $property->isInitialized($target)) { + return; } return $property->getValue($target);