/** * Outputs the parameter table * * @param \PartKeepr\Service\ServiceCallReflector $call The reflected call * @param \Symfony\Component\Console\Output\OutputInterface $output The output interface */ private function outputParameterTable(ServiceCallReflector $call, Console\Output\OutputInterface $output) { $output->writeln("<info>Parameters:</info>"); $head = array('Name', 'Required', 'Type', 'Description'); $parameterTable = array(); foreach ($call->getParameters() as $parameter) { $parameterTable[] = array($parameter->getName(), $parameter->getRequiredFlag() ? 'Yes' : 'No', $parameter->getType(), $parameter->getDescription()); } $table = new TablePrinter($output); $table->setHeader($head); $table->setBody($parameterTable); $table->output(); }
/** * Returns all calls for the service * @return ServiceCallReflector[] An array of ServiceCallReflector objects */ public function getCalls() { $calls = array(); foreach ($this->reflClass->getMethods() as $method) { if (ServiceCallReflector::isServiceCall($method, $this->reader)) { $calls[] = new ServiceCallReflector($method, $this->reader); } } return $calls; }