getRecord(); if (! is_object($record) || ! method_exists($record, 'getBadgePath')) { return ''; } $path = $record->getBadgePath(); return is_string($path) ? $path : ''; } public function getBadgeName(): string { $record = $this->getRecord(); if (! is_object($record) || ! method_exists($record, 'getBadgeName')) { return ''; } $name = $record->getBadgeName(); return is_string($name) ? $name : ''; } }