/** * Code executed when command invoked. * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { foreach ($this->classes as $className) { $output->write('Generating "<info>' . $className . '</info>" '); $this->hydratorFactory->getHydratorClassName($className); $output->writeLn('<comment>Done</comment>'); } }
/** * @test */ public function itShouldReturnAnHydratorClassName() { $hydratorFactory = new HydratorFactory(__DIR__ . DIRECTORY_SEPARATOR . 'cache', true); $hydratorClassName = $hydratorFactory->getHydratorClassName(Serializable::class); $this->assertNotNull($hydratorClassName); $this->assertTrue(is_subclass_of($hydratorClassName, HydratorInterface::class)); }
/** * Code executed when command invoked. * * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $proxyPath = $input->getArgument('cache-path'); $className = $input->getArgument('class'); $hydratorFactory = new HydratorFactory($proxyPath); $output->write('Generating "<info>' . $className . '</info>" '); $hydratorFactory->getHydratorClassName($className); $output->writeLn('<comment>Done</comment>'); }