Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositorySymbol.php
| <?php | <?php | ||||
| /** | /** | ||||
| * Records information about symbol locations in a codebase, like where classes | * Records information about symbol locations in a codebase, like where classes | ||||
| * and functions are defined. | * and functions are defined. | ||||
| * | * | ||||
| * Query symbols with @{class:DiffusionSymbolQuery}. | * Query symbols with @{class:DiffusionSymbolQuery}. | ||||
| */ | */ | ||||
| final class PhabricatorRepositorySymbol extends PhabricatorRepositoryDAO { | final class PhabricatorRepositorySymbol extends PhabricatorRepositoryDAO { | ||||
| protected $arcanistProjectID; | protected $repositoryPHID; | ||||
| protected $symbolContext; | protected $symbolContext; | ||||
epriestley: Maybe because this class removes `arcanistProjectID` but doesn't add `protected… | |||||
Not Done Inline ActionsAh thanks. joshuaspence: Ah thanks. | |||||
| protected $symbolName; | protected $symbolName; | ||||
| protected $symbolType; | protected $symbolType; | ||||
| protected $symbolLanguage; | protected $symbolLanguage; | ||||
| protected $pathID; | protected $pathID; | ||||
| protected $lineNumber; | protected $lineNumber; | ||||
| private $path = self::ATTACHABLE; | private $path = self::ATTACHABLE; | ||||
| private $arcanistProject = self::ATTACHABLE; | |||||
| private $repository = self::ATTACHABLE; | private $repository = self::ATTACHABLE; | ||||
| protected function getConfiguration() { | protected function getConfiguration() { | ||||
| return array( | return array( | ||||
| self::CONFIG_IDS => self::IDS_MANUAL, | |||||
| self::CONFIG_TIMESTAMPS => false, | self::CONFIG_TIMESTAMPS => false, | ||||
| self::CONFIG_COLUMN_SCHEMA => array( | self::CONFIG_COLUMN_SCHEMA => array( | ||||
| 'id' => null, | 'id' => null, | ||||
| 'symbolContext' => 'text128', | 'symbolContext' => 'text128', | ||||
| 'symbolName' => 'text128', | 'symbolName' => 'text128', | ||||
| 'symbolType' => 'text12', | 'symbolType' => 'text12', | ||||
| 'symbolLanguage' => 'text32', | 'symbolLanguage' => 'text32', | ||||
| 'lineNumber' => 'uint32', | 'lineNumber' => 'uint32', | ||||
| ), | ), | ||||
| self::CONFIG_KEY_SCHEMA => array( | self::CONFIG_KEY_SCHEMA => array( | ||||
| 'PRIMARY' => null, | 'PRIMARY' => null, | ||||
| 'symbolName' => array( | 'symbolName' => array( | ||||
| 'columns' => array('symbolName'), | 'columns' => array('symbolName'), | ||||
| ), | ), | ||||
| ), | ), | ||||
| ) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
| } | } | ||||
| public function getURI() { | public function getURI() { | ||||
| if (!$this->repository) { | |||||
| // This symbol is in the index, but we don't know which Repository it's | |||||
| // part of. Usually this means the Arcanist Project hasn't been linked | |||||
| // to a Repository. We can't generate a URI, so just fail. | |||||
| return null; | |||||
| } | |||||
| $request = DiffusionRequest::newFromDictionary( | $request = DiffusionRequest::newFromDictionary( | ||||
| array( | array( | ||||
| 'user' => PhabricatorUser::getOmnipotentUser(), | 'user' => PhabricatorUser::getOmnipotentUser(), | ||||
| 'repository' => $this->getRepository(), | 'repository' => $this->getRepository(), | ||||
| )); | )); | ||||
| return $request->generateURI( | return $request->generateURI( | ||||
| array( | array( | ||||
| 'action' => 'browse', | 'action' => 'browse', | ||||
| Show All 10 Lines | public function attachPath($path) { | ||||
| $this->path = $path; | $this->path = $path; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getRepository() { | public function getRepository() { | ||||
| return $this->assertAttached($this->repository); | return $this->assertAttached($this->repository); | ||||
| } | } | ||||
| public function attachRepository($repository) { | public function attachRepository(PhabricatorRepository $repository) { | ||||
| $this->repository = $repository; | $this->repository = $repository; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getArcanistProject() { | |||||
| return $this->assertAttached($this->arcanistProject); | |||||
| } | |||||
| public function attachArcanistProject($project) { | |||||
| $this->arcanistProject = $project; | |||||
| return $this; | |||||
| } | |||||
| } | } | ||||
Maybe because this class removes arcanistProjectID but doesn't add protected $repositoryPHID?