Content-Length: 789167 | pFad | http://github.com/Payum/PaypalRest/commit/c98d955b7b53b18a39f45f996b7254eabc631fee

4D Add void return type to all methods · Payum/PaypalRest@c98d955 · GitHub
Skip to content

Commit c98d955

Browse files
committed
Add void return type to all methods
1 parent 9ac3acf commit c98d955

9 files changed

+30
-30
lines changed

Action/CaptureAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct()
3535
$this->apiClass = ApiContext::class;
3636
}
3737

38-
public function execute($request)
38+
public function execute($request): void
3939
{
4040
/** @var Capture $request */
4141
RequestNotSupportedException::assertSupports($this, $request);

Action/ConvertAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ConvertAction implements ActionInterface, GatewayAwareInterface
1515
{
1616
use GatewayAwareTrait;
1717

18-
public function execute($request)
18+
public function execute($request): void
1919
{
2020
RequestNotSupportedException::assertSupports($this, $request);
2121

Action/StatusAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct()
2323
/**
2424
* @var GetStatusInterface
2525
*/
26-
public function execute($request)
26+
public function execute($request): void
2727
{
2828
RequestNotSupportedException::assertSupports($this, $request);
2929

Action/SyncAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SyncAction implements ActionInterface, GatewayAwareInterface
1313
{
1414
use GatewayAwareTrait;
1515

16-
public function execute($request)
16+
public function execute($request): void
1717
{
1818
/** @var Sync $request */
1919
RequestNotSupportedException::assertSupports($this, $request);

PaypalRestGatewayFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class PaypalRestGatewayFactory extends GatewayFactory
1717
{
18-
protected function populateConfig(ArrayObject $config)
18+
protected function populateConfig(ArrayObject $config): void
1919
{
2020
if (false == class_exists(ApiContext::class)) {
2121
throw new LogicException('You must install "paypal/rest-api-sdk-php" library.');

Tests/Action/CaptureActionTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class CaptureActionTest extends TestCase
1616
{
17-
public function testShouldSupportCaptureWithPaymentSdkModel()
17+
public function testShouldSupportCaptureWithPaymentSdkModel(): void
1818
{
1919
$action = new CaptureAction();
2020

@@ -25,7 +25,7 @@ public function testShouldSupportCaptureWithPaymentSdkModel()
2525
$this->assertTrue($action->supports($request));
2626
}
2727

28-
public function testShouldSupportCaptureWithArrayObjectModel()
28+
public function testShouldSupportCaptureWithArrayObjectModel(): void
2929
{
3030
$action = new CaptureAction();
3131

@@ -36,7 +36,7 @@ public function testShouldSupportCaptureWithArrayObjectModel()
3636
$this->assertTrue($action->supports($request));
3737
}
3838

39-
public function testShouldNotSupportCapturePaymentSdkModel()
39+
public function testShouldNotSupportCapturePaymentSdkModel(): void
4040
{
4141
$action = new CaptureAction();
4242

@@ -45,22 +45,22 @@ public function testShouldNotSupportCapturePaymentSdkModel()
4545
$this->assertFalse($action->supports($request));
4646
}
4747

48-
public function testThrowIfNotSupportedRequestGivenAsArgumentForExecute()
48+
public function testThrowIfNotSupportedRequestGivenAsArgumentForExecute(): void
4949
{
5050
$this->expectException(RequestNotSupportedException::class);
5151
$action = new CaptureAction();
5252

5353
$action->execute(new stdClass());
5454
}
5555

56-
public function testShouldNotSupportNotCapture()
56+
public function testShouldNotSupportNotCapture(): void
5757
{
5858
$action = new CaptureAction();
5959

6060
$this->assertFalse($action->supports(new stdClass()));
6161
}
6262

63-
public function testShouldSupportCapture()
63+
public function testShouldSupportCapture(): void
6464
{
6565
$action = new CaptureAction();
6666

@@ -70,7 +70,7 @@ public function testShouldSupportCapture()
7070
$this->assertTrue($action->supports(new Capture(new ArrayObject())));
7171
}
7272

73-
public function testThrowIfNotSupportedApiContext()
73+
public function testThrowIfNotSupportedApiContext(): void
7474
{
7575
$this->expectException(UnsupportedApiException::class);
7676
$action = new CaptureAction();

Tests/Action/ConvertActionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function provideNotSupportedRequests(): Iterator
3636
yield [new $this->requestClass($this->createMock(PaymentInterface::class), 'foobar')];
3737
}
3838

39-
public function testShouldCorrectlyConvertOrderToDetailsAndSetItBack()
39+
public function testShouldCorrectlyConvertOrderToDetailsAndSetItBack(): void
4040
{
4141
$payment = new Payment();
4242
$payment->setNumber('theNumber');
@@ -81,7 +81,7 @@ public function testShouldCorrectlyConvertOrderToDetailsAndSetItBack()
8181
$this->assertSame('https://example.com', $details['return_url']);
8282
}
8383

84-
public function testShouldNotOverwriteAlreadySetExtraDetails()
84+
public function testShouldNotOverwriteAlreadySetExtraDetails(): void
8585
{
8686
$payment = new Payment();
8787
$payment->setCurrencyCode('USD');

Tests/Action/StatusActionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
class StatusActionTest extends TestCase
1616
{
17-
public function testShouldImplementsActionInterface()
17+
public function testShouldImplementsActionInterface(): void
1818
{
1919
$rc = new ReflectionClass(StatusAction::class);
2020

2121
$this->assertTrue($rc->implementsInterface(ActionInterface::class));
2222
}
2323

24-
public function testShouldNotSupportStatusRequestWithNoPaymentAsModel()
24+
public function testShouldNotSupportStatusRequestWithNoPaymentAsModel(): void
2525
{
2626
$action = new StatusAction();
2727

@@ -30,7 +30,7 @@ public function testShouldNotSupportStatusRequestWithNoPaymentAsModel()
3030
$this->assertFalse($action->supports($request));
3131
}
3232

33-
public function testShouldSupportStatusRequestWithArrayObjectAsModel()
33+
public function testShouldSupportStatusRequestWithArrayObjectAsModel(): void
3434
{
3535
$action = new StatusAction();
3636

@@ -39,22 +39,22 @@ public function testShouldSupportStatusRequestWithArrayObjectAsModel()
3939
$this->assertTrue($action->supports($request));
4040
}
4141

42-
public function testShouldNotSupportAnythingNotStatusRequest()
42+
public function testShouldNotSupportAnythingNotStatusRequest(): void
4343
{
4444
$action = new StatusAction();
4545

4646
$this->assertFalse($action->supports(new stdClass()));
4747
}
4848

49-
public function testThrowIfNotSupportedRequestGivenAsArgumentForExecute()
49+
public function testThrowIfNotSupportedRequestGivenAsArgumentForExecute(): void
5050
{
5151
$this->expectException(RequestNotSupportedException::class);
5252
$action = new StatusAction();
5353

5454
$action->execute(new stdClass());
5555
}
5656

57-
public function testShouldMarkPendingIfStateCreated()
57+
public function testShouldMarkPendingIfStateCreated(): void
5858
{
5959
$action = new StatusAction();
6060

@@ -77,7 +77,7 @@ public function testShouldMarkPendingIfStateCreated()
7777
$this->assertTrue($request->isPending());
7878
}
7979

80-
public function testShouldMarkNewIfStateNotSet()
80+
public function testShouldMarkNewIfStateNotSet(): void
8181
{
8282
$action = new StatusAction();
8383

@@ -97,7 +97,7 @@ public function testShouldMarkNewIfStateNotSet()
9797
$this->assertTrue($request->isNew());
9898
}
9999

100-
public function testShouldMarkCapturedIfStateApproved()
100+
public function testShouldMarkCapturedIfStateApproved(): void
101101
{
102102
$action = new StatusAction();
103103

@@ -120,7 +120,7 @@ public function testShouldMarkCapturedIfStateApproved()
120120
$this->assertTrue($request->isCaptured());
121121
}
122122

123-
public function testShouldMarkCanceledIfStateCanceled()
123+
public function testShouldMarkCanceledIfStateCanceled(): void
124124
{
125125
$action = new StatusAction();
126126

@@ -143,7 +143,7 @@ public function testShouldMarkCanceledIfStateCanceled()
143143
$this->assertTrue($request->isCanceled());
144144
}
145145

146-
public function testShouldMarkUnknownIfStateIsSetAndSetUnknown()
146+
public function testShouldMarkUnknownIfStateIsSetAndSetUnknown(): void
147147
{
148148
$action = new StatusAction();
149149

Tests/PaypalRestGatewayFactoryTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class PaypalRestGatewayFactoryTest extends AbstractGatewayFactoryTest
1212
{
13-
public function testShouldAllowCreateGatewayWithCustomConfig()
13+
public function testShouldAllowCreateGatewayWithCustomConfig(): void
1414
{
1515
$factory = new PaypalRestGatewayFactory();
1616

@@ -45,7 +45,7 @@ public function testShouldAllowCreateGatewayWithCustomConfig()
4545
}
4646
}
4747

48-
public function testShouldAddDefaultConfigPassedInConstructorWhileCreatingGatewayConfig()
48+
public function testShouldAddDefaultConfigPassedInConstructorWhileCreatingGatewayConfig(): void
4949
{
5050
$factory = new PaypalRestGatewayFactory([
5151
'foo' => 'fooVal',
@@ -63,7 +63,7 @@ public function testShouldAddDefaultConfigPassedInConstructorWhileCreatingGatewa
6363
$this->assertSame('barVal', $config['bar']);
6464
}
6565

66-
public function testShouldConfigContainDefaultOptions()
66+
public function testShouldConfigContainDefaultOptions(): void
6767
{
6868
$factory = new PaypalRestGatewayFactory();
6969

@@ -80,7 +80,7 @@ public function testShouldConfigContainDefaultOptions()
8080
], $config['payum.default_options']);
8181
}
8282

83-
public function testShouldConfigContainFactoryNameAndTitle()
83+
public function testShouldConfigContainFactoryNameAndTitle(): void
8484
{
8585
$factory = new PaypalRestGatewayFactory();
8686

@@ -95,7 +95,7 @@ public function testShouldConfigContainFactoryNameAndTitle()
9595
$this->assertSame('PayPal Rest', $config['payum.factory_title']);
9696
}
9797

98-
public function testShouldThrowIfRequiredOptionsNotPassed()
98+
public function testShouldThrowIfRequiredOptionsNotPassed(): void
9999
{
100100
$this->expectException(LogicException::class);
101101
$this->expectExceptionMessage('The client_id, client_secret fields are required.');
@@ -104,7 +104,7 @@ public function testShouldThrowIfRequiredOptionsNotPassed()
104104
$factory->create();
105105
}
106106

107-
public function testShouldThrowIfConfigPathOptionsNotEqualPaypalPath()
107+
public function testShouldThrowIfConfigPathOptionsNotEqualPaypalPath(): void
108108
{
109109
define('PP_CONFIG_PATH', __DIR__);
110110

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Payum/PaypalRest/commit/c98d955b7b53b18a39f45f996b7254eabc631fee

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy