Skip to content

Commit

Permalink
Fix PHP 7.4 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometee committed Nov 22, 2024
1 parent d0760b6 commit fee6675
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
20 changes: 10 additions & 10 deletions spec/Extension/CancelExistingPaymentIntentExtensionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public function it_doesnt_found_the_related_session_and_do_nothing(
->willReturn($allSessionRequest);

$allSessionRequest->setParameters([
'payment_intent' => $piId
'payment_intent' => $piId,
])->shouldBeCalled();
$allSessionRequest->getApiResources()->willReturn(Collection::constructFrom(['data'=>[]]));
$allSessionRequest->getApiResources()->willReturn(Collection::constructFrom(['data' => []]));

$gateway->execute($allSessionRequest)->shouldBeCalled();

Expand Down Expand Up @@ -139,15 +139,15 @@ public function it_founds_a_related_expired_session_and_does_nothing(
->willReturn($allSessionRequest);

$allSessionRequest->setParameters([
'payment_intent' => $piId
'payment_intent' => $piId,
])->shouldBeCalled();
$allSessionRequest->getApiResources()->willReturn(Collection::constructFrom([
'data'=>[
'data' => [
[
'id' => $csId,
'status' => Session::STATUS_EXPIRED,
]
]
],
],
]));

$gateway->execute($allSessionRequest)->shouldBeCalled();
Expand Down Expand Up @@ -183,15 +183,15 @@ public function it_founds_a_related_session_and_expires_it(
->willReturn($allSessionRequest);

$allSessionRequest->setParameters([
'payment_intent' => $piId
'payment_intent' => $piId,
])->shouldBeCalled();
$allSessionRequest->getApiResources()->willReturn(Collection::constructFrom([
'data'=>[
'data' => [
[
'id' => $csId,
'status' => Session::STATUS_OPEN,
]
]
],
],
]));

$gateway->execute($allSessionRequest)->shouldBeCalled();
Expand Down
6 changes: 3 additions & 3 deletions spec/StateMachine/CancelOrderProcessorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

use FluxSE\SyliusPayumStripePlugin\Command\CancelPayment;
use PhpSpec\ObjectBehavior;
use SM\Event\TransitionEvent;
use Sylius\Component\Core\Model\PaymentInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\MessageBusInterface;

final class CancelOrderProcessorSpec extends ObjectBehavior
{
public function let(MessageBusInterface $commandBus): void {
public function let(MessageBusInterface $commandBus): void
{
$this->beConstructedWith($commandBus);
}

public function it_is_invokable_when_it_is_new(
PaymentInterface $payment,
MessageBusInterface $commandBus,
MessageBusInterface $commandBus
): void {
$payment->getId()->willReturn(1);

Expand Down
4 changes: 2 additions & 2 deletions spec/StateMachine/CaptureAuthorizedOrderProcessorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use FluxSE\SyliusPayumStripePlugin\Command\CaptureAuthorizedPayment;
use PhpSpec\ObjectBehavior;
use SM\Event\TransitionEvent;
use Sylius\Component\Core\Model\PaymentInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\MessageBusInterface;

final class CaptureAuthorizedOrderProcessorSpec extends ObjectBehavior
{
public function let(MessageBusInterface $commandBus): void {
public function let(MessageBusInterface $commandBus): void
{
$this->beConstructedWith($commandBus);
}

Expand Down
5 changes: 2 additions & 3 deletions spec/StateMachine/RefundOrderProcessorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

use FluxSE\SyliusPayumStripePlugin\Command\RefundPayment;
use PhpSpec\ObjectBehavior;
use SM\Event\TransitionEvent;
use Sylius\Component\Core\Model\PaymentInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\MessageBusInterface;

final class RefundOrderProcessorSpec extends ObjectBehavior
{
public function let(MessageBusInterface $commandBus): void {
public function let(MessageBusInterface $commandBus): void
{
$this->beConstructedWith($commandBus, false);
}

Expand All @@ -33,7 +33,6 @@ public function it_do_nothing_when_it_is_disabled(
PaymentInterface $payment,
MessageBusInterface $commandBus
): void {

$this->beConstructedWith($commandBus, true);

$command = new RefundPayment(1);
Expand Down
10 changes: 8 additions & 2 deletions tests/Behat/Bug/PantherCookieSetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@

final class PantherCookieSetter implements CookieSetterInterface
{
private Session $minkSession;

private CookieSetterInterface $decoratedCookieSetter;

public function __construct(
private Session $minkSession,
private CookieSetterInterface $decoratedCookieSetter
Session $minkSession,
CookieSetterInterface $decoratedCookieSetter
) {
$this->decoratedCookieSetter = $decoratedCookieSetter;
$this->minkSession = $minkSession;
}

public function setCookie($name, $value): void
Expand Down

0 comments on commit fee6675

Please sign in to comment.