invoiceValidator = $invoiceValidator; $this->orderValidator = $orderValidator; $this->validatorResultMerger = $validatorResultMerger; } /** * @inheritdoc */ public function validate( OrderInterface $order, InvoiceInterface $invoice, $capture = false, array $items = [], $notify = false, $appendComment = false, InvoiceCommentCreationInterface $comment = null, InvoiceCreationArgumentsInterface $arguments = null ) { return $this->validatorResultMerger->merge( $this->invoiceValidator->validate( $invoice, [InvoiceQuantityValidator::class] ), $this->orderValidator->validate( $order, [CanInvoice::class] ) ); } }