/** * @param OrderInterface $order * @param InvoiceModelWithPrivateMethods $invoice */ private function copyAllValues(OrderInterface $order, InvoiceModelWithPrivateMethods $invoice) { $results = $this->extractor->extract($invoice); /** @var ExtractorResult $result */ foreach ($results as $result) { if ($this->invoiceTransformer->supports($result->getPropertyName())) { $this->invoiceTransformer->transform($order, $result); } } }
/** * @param OrderInterface $order * @param UserOrderModelWithPrivateMethods $userOrder */ private function copyAllValues(OrderInterface $order, UserOrderModelWithPrivateMethods $userOrder) { $results = $this->annotationsExtractor->extract($userOrder); /** @var ExtractorResult $result */ foreach ($results as $result) { if ($this->generalTransformer->supports($result->getPropertyName())) { $this->generalTransformer->transform($order, $result); } } }
/** * @param mixed $usersShippingMethod * * @return ShippingMethod */ public function transform($usersShippingMethod) { $shippingMethod = new ShippingMethod(); foreach ($this->extractor->extract($usersShippingMethod) as $extractedResult) { if ($this->supports($extractedResult->getPropertyName())) { $this->copyValue($shippingMethod, $extractedResult); } } return $shippingMethod; }
/** * @param object $userProduct * * @return ExtractorResult[] */ private function getExtractedAnnotations($userProduct) { return $this->extractor->extract($userProduct); }
/** * @expectedException \Team3\PayU\PropertyExtractor\ExtractorException */ public function testThrowingExceptionWhenArrayGiven() { $this->extractor->extract([]); }
public function let(ExtractorInterface $extractor) { $this->prophet = new Prophet(); $extractor->extract(new Argument\Token\AnyValuesToken())->willReturn($this->getAnnotationsExtractorResults()); $this->beConstructedWith($extractor); }
/** * @param $userOrder * * @return ExtractorResult[] */ protected function getExtractedResults($userOrder) { return $this->extractor->extract($userOrder); }