for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
namespace Overblog\GraphQLBundle\Command;
use Overblog\GraphQLBundle\Generator\TypeGenerator;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\Output;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
class GeneratorCommand extends Command
{
private $typeGenerator;
public function __construct(TypeGenerator $typeGenerator)
parent::__construct();
$this->typeGenerator = $typeGenerator;
}
protected function configure()
$this
->setName('graphql:generator')
->setDescription('Execute manually types generation.')
;
protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('<info>Types generation starts</info>');
$classes = $this->typeGenerator->compile(TypeGenerator::MODE_WRITE | TypeGenerator::MODE_OVERRIDE);
$output->writeln('<info>Types generation ends successfully</info>');
if ($output->getVerbosity() >= Output::VERBOSITY_VERBOSE) {
$io = new SymfonyStyle($input, $output);
$io->title('Summary');
$rows = [];
foreach ($classes as $class => $path) {
$rows[] = [$class, $path];
$io->table(['class', 'path'], $rows);