addArgument('slug', InputArgument::REQUIRED, 'Employee-Slug'); } protected function execute(InputInterface $input, OutputInterface $output): int { $employee = $this->employees->findOneBy(['slug' => $input->getArgument('slug')]); if (null === $employee) { $output->writeln('Mitarbeiter nicht gefunden.'); return Command::FAILURE; } $template = $this->templates->findCardForCompany($employee->getCompany()) ?? $this->factory->default(); $pdf = $this->renderer->render($employee, $template); $file = sprintf('/tmp/render-%s.pdf', gethostname()); file_put_contents($file, $pdf); $output->writeln(sprintf( 'Node %s: %d bytes, Hintergrund=%s, Datei=%s', gethostname(), strlen($pdf), $template->getBackgroundPath() ? 'ja' : 'nein', $file, )); return Command::SUCCESS; } }