/** * Retrieves the instance of ComponentHelper for this project */ public static function getComponentHelper(Project $project) { if ($project === null) { return null; } $ph = $project->getReference(self::COMPONENT_HELPER_REFERENCE); if ($ph !== null) { return $ph; } $ph = new ComponentHelper(); $ph->setProject($project); $project->addReference(self::COMPONENT_HELPER_REFERENCE, $ph); return $ph; }