Skip to content

Commit

Permalink
[RefundPayment] Fixes after static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
GSadee committed Jun 9, 2021
1 parent 545d719 commit 8a526ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
15 changes: 8 additions & 7 deletions spec/Factory/RefundPaymentFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ public function it_creates_new_refund_payment(
RefundPaymentInterface::STATE_NEW,
1
)
->shouldBeLike(new RefundPayment(
->shouldBeLike(
new RefundPayment(
$order->getWrappedObject(),
1000,
'USD',
RefundPaymentInterface::STATE_NEW,
$paymentMethod->getWrappedObject()
)
);
1000,
'USD',
RefundPaymentInterface::STATE_NEW,
$paymentMethod->getWrappedObject()
)
);
}
}
2 changes: 1 addition & 1 deletion src/Entity/RefundPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getOrder(): OrderInterface

public function getOrderNumber(): string
{
return $this->getOrder()->getNumber();
return (string) $this->getOrder()->getNumber();
}

public function getAmount(): int
Expand Down
3 changes: 2 additions & 1 deletion src/Migrations/Version20210609071246.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function down(Schema $schema): void
$this->addSql('DROP INDEX IDX_EC283EA58D9F6D38 ON sylius_refund_refund_payment');
$this->addSql('ALTER TABLE sylius_refund_refund_payment ADD order_number VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');

$this->addSql('
$this->addSql(
'
UPDATE sylius_refund_refund_payment
SET sylius_refund_refund_payment.order_number = (
SELECT sylius_order.number FROM sylius_order WHERE sylius_order.id = sylius_refund_refund_payment.order_id
Expand Down

0 comments on commit 8a526ab

Please sign in to comment.