/** * @param PrinterProfileInterface $printerProfile * @return array */ private function getOptionArgumentsByPrinterProfile(PrinterProfileInterface $printerProfile) { $arguments = []; foreach ($printerProfile->getOptions() as $key => $value) { $arguments[] = '-o'; $arguments[] = $value !== null ? implode($key == PrinterProfile::MEDIA_SIZE_CUSTOM ? '.' : '=', [$key, $value]) : $key; } return $arguments; }
/** * PrinterProfileNotFoundException constructor. * @param PrinterProfileInterface $printerProfile * @param int $message * @param Exception $code * @param Exception $previous */ public function __construct(PrinterProfileInterface $printerProfile, Exception $previous = null) { $this->printerProfile = $printerProfile; parent::__construct(sprintf('Printer profile "%s" not found.', $printerProfile->getName()), 0, $previous); }