protected function getTestPdf($which = 1) { $image_filename = $this->operation_factory->getProcessor()->getTempFilename('test_pad_'); // Don't use the original image. File does file_put_contents() when you call ->setImageData(). copy(__DIR__ . '/images/test_pdf_' . $which . '.pdf', $image_filename); return new File($image_filename); }
public function __call($method, $args) { if ($this->current_operation) { call_user_func_array(array($this->current_operation, $method), $args); } else { $operation = $this->operation_factory->getOperation($method); $processor = $this->operation_factory->getProcessor(); $processor->addOperation($operation); if ($operation instanceof OneShotHasArgument && isset($args[0])) { // If it's a one-shot with argument, and there's an argument. $operation->setValue($args[0]); } elseif (!$operation instanceof OneShotOperation || $operation instanceof OneShotHasArgument && !isset($args[0])) { // If it's not a one-shot, or if it's a one-shot but no arguments were passed... $this->current_operation = $operation; } // else: If it's a one-shot without arguments, it just gets added (e.g. Strip) } return $this; }