Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/controller/HeraldTestConsoleController.php
Show All 33 Lines | if ($request->isFormPost()) { | ||||
// TODO: Let the adapters claim objects instead. | // TODO: Let the adapters claim objects instead. | ||||
if ($object instanceof DifferentialRevision) { | if ($object instanceof DifferentialRevision) { | ||||
$adapter = HeraldDifferentialRevisionAdapter::newLegacyAdapter( | $adapter = HeraldDifferentialRevisionAdapter::newLegacyAdapter( | ||||
$object, | $object, | ||||
$object->loadActiveDiff()); | $object->loadActiveDiff()); | ||||
} else if ($object instanceof PhabricatorRepositoryCommit) { | } else if ($object instanceof PhabricatorRepositoryCommit) { | ||||
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere( | $adapter = id(new HeraldCommitAdapter()) | ||||
'commitID = %d', | ->setCommit($object); | ||||
$object->getID()); | |||||
$adapter = HeraldCommitAdapter::newLegacyAdapter( | |||||
$object->getRepository(), | |||||
$object, | |||||
$data); | |||||
} else if ($object instanceof ManiphestTask) { | } else if ($object instanceof ManiphestTask) { | ||||
$adapter = id(new HeraldManiphestTaskAdapter()) | $adapter = id(new HeraldManiphestTaskAdapter()) | ||||
->setTask($object); | ->setTask($object); | ||||
} else if ($object instanceof PholioMock) { | } else if ($object instanceof PholioMock) { | ||||
$adapter = id(new HeraldPholioMockAdapter()) | $adapter = id(new HeraldPholioMockAdapter()) | ||||
->setMock($object); | ->setMock($object); | ||||
} else { | } else { | ||||
throw new Exception("Can not build adapter for object!"); | throw new Exception("Can not build adapter for object!"); | ||||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |