/** * Gets an instance of the Phabricator API client class for a project. * * @param string $project The Phabricator project name * @return Nasqueron\Notifications\Phabricator\PhabricatorAPI */ public function getForProject($project) { return PhabricatorAPI::forProject($project); }
/** * Gets the project for a specific item, using the new ApplicationSearch. * * This is a transitional method: when every Phabricator will have been * migrated from info (generation 1) or query (generation 2) to search * (generation 3), we'll rename it to getItemProjectsPHIDs and overwrite it. */ protected function getItemProjectsPHIDsThroughApplicationSearch($method, $objectPHID) { if (!$objectPHID) { return []; } $api = PhabricatorAPI::forProject($this->instanceName); $reply = $api->call($method, ['constraints[phids][0]' => $objectPHID, 'attachments[projects]' => 1]); return PhabricatorAPI::getFirstResult($reply)->attachments->projects->projectPHIDs; }
/** * @expectedException \RuntimeException */ public function testForProjectWhenProjectDoesNotExist() { PhabricatorAPI::forProject("NotFound"); }
/** * Calls the diffusion.looksoon API method. * * @throws PhabricatorAPIException */ private function callDiffusionLookSoon() { $this->api->call('diffusion.looksoon', ['callsigns[0]' => $this->callSign]); }