Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/workflow/DivinerAtomizeWorkflow.php
| Show All 30 Lines | final class DivinerAtomizeWorkflow extends DivinerWorkflow { | ||||
| public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
| $this->readBookConfiguration($args->getArg('book')); | $this->readBookConfiguration($args->getArg('book')); | ||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| $atomizer_class = $args->getArg('atomizer'); | $atomizer_class = $args->getArg('atomizer'); | ||||
| if (!$atomizer_class) { | if (!$atomizer_class) { | ||||
| throw new Exception( | throw new PhutilArgumentUsageException( | ||||
| pht('Specify an atomizer class with %s.', '--atomizer')); | pht( | ||||
| 'Specify an atomizer class with %s.', | |||||
| '--atomizer')); | |||||
| } | } | ||||
| $symbols = id(new PhutilSymbolLoader()) | $symbols = id(new PhutilSymbolLoader()) | ||||
| ->setName($atomizer_class) | ->setName($atomizer_class) | ||||
| ->setConcreteOnly(true) | ->setConcreteOnly(true) | ||||
| ->setAncestorClass('DivinerAtomizer') | ->setAncestorClass('DivinerAtomizer') | ||||
| ->selectAndLoadSymbols(); | ->selectAndLoadSymbols(); | ||||
| if (!$symbols) { | if (!$symbols) { | ||||
| throw new Exception( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| "Atomizer class '%s' must be a concrete subclass of %s.", | "Atomizer class '%s' must be a concrete subclass of %s.", | ||||
| $atomizer_class, | $atomizer_class, | ||||
| 'DivinerAtomizer')); | 'DivinerAtomizer')); | ||||
| } | } | ||||
| $atomizer = newv($atomizer_class, array()); | $atomizer = newv($atomizer_class, array()); | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||