Path: blob/master/src/applications/guides/guidance/PhabricatorGuidanceEngineExtension.php
13463 views
<?php12abstract class PhabricatorGuidanceEngineExtension3extends Phobject {45final public function getExtensionKey() {6return $this->getPhobjectClassConstant('GUIDANCEKEY', 64);7}89abstract public function canGenerateGuidance(10PhabricatorGuidanceContext $context);1112abstract public function generateGuidance(13PhabricatorGuidanceContext $context);1415public function didGenerateGuidance(16PhabricatorGuidanceContext $context,17array $guidance) {18return $guidance;19}2021final protected function newGuidance($key) {22return id(new PhabricatorGuidanceMessage())23->setKey($key);24}2526final protected function newWarning($key) {27return $this->newGuidance($key)28->setSeverity(PhabricatorGuidanceMessage::SEVERITY_WARNING);29}3031final public static function getAllExtensions() {32return id(new PhutilClassMapQuery())33->setAncestorClass(__CLASS__)34->setUniqueMethod('getExtensionKey')35->execute();36}3738}394041