Skip to content

Commit d8c6bb1

Browse files
committed
Code format. Travis matrix.
1 parent 7703e8f commit d8c6bb1

14 files changed

+66
-41
lines changed

Diff for: .travis.yml

+25-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
11
language: php
22

3-
php:
4-
- 7.1
5-
- 7.1snapshot
6-
- master
3+
git:
4+
depth: 10
75

86
sudo: false
97

8+
cache:
9+
directories:
10+
- $HOME/.composer/cache
11+
12+
matrix:
13+
include:
14+
- php: 7.0
15+
env: SYMFONY_VERSION=v3
16+
- php: 7.1
17+
env: SYMFONY_VERSION=v3
18+
- php: 7.2
19+
env: SYMFONY_VERSION=v3
20+
- php: 7.1
21+
env: SYMFONY_VERSION=v4
22+
- php: 7.2
23+
env: SYMFONY_VERSION=v4
24+
- php: 7.3
25+
env: SYMFONY_VERSION=v4
26+
1027
before_install:
1128
- composer self-update
12-
- composer clear-cache
1329

1430
install:
15-
- travis_retry composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable
31+
- composer require dunglas/symfony-lock:${SYMFONY_VERSION} --no-update
32+
- composer install --prefer-source
1633

1734
script:
1835
- ./vendor/bin/phpunit
1936

2037
notifications:
21-
email: false
22-
38+
email:
39+
- contact@ekyna.com

Diff for: phpunit.xml

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
4-
backupGlobals="false"
2+
<phpunit backupGlobals="true"
3+
backupStaticAttributes="false"
54
colors="true"
5+
convertErrorsToExceptions="true"
6+
convertNoticesToExceptions="true"
7+
convertWarningsToExceptions="true"
8+
processIsolation="false"
9+
stopOnFailure="false"
10+
syntaxCheck="false"
611
bootstrap="tests/bootstrap.php">
712

813
<testsuites>

Diff for: src/Action/Api/AbstractApiAction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected function logData($message, array $data, array $filterKeys = [])
8282
$data = array_intersect_key($data, array_flip($filterKeys));
8383
}
8484

85-
$data = array_map(function($key, $value) {
85+
$data = array_map(function ($key, $value) {
8686
return "$key: $value";
8787
}, array_keys($data), $data);
8888

Diff for: src/Action/Api/PaymentResponseAction.php

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Payum\Core\Bridge\Spl\ArrayObject;
77
use Payum\Core\Exception\RequestNotSupportedException;
88
use Payum\Core\Request\GetHttpRequest;
9+
910
/**
1011
* Class PaymentResponseAction
1112
* @package Ekyna\Component\Payum\Monetico

Diff for: src/Action/StatusAction.php

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function execute($request)
2929
if (false != $code = $model['state_override']) {
3030
if ($code === 'canceled') {
3131
$request->markCanceled();
32+
3233
return;
3334
}
3435
}

Diff for: src/Api/Api.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private function htmlEncode($data)
270270
for ($i = 0; $i < strlen($data); $i++) {
271271
if (strstr($safeChars, $data[$i])) {
272272
$result .= $data[$i];
273-
} else if ("7F" >= $var = bin2hex(substr($data, $i, 1))) {
273+
} elseif ("7F" >= $var = bin2hex(substr($data, $i, 1))) {
274274
$result .= "&#x" . $var . ";";
275275
} else {
276276
$result .= $data[$i];
@@ -420,7 +420,8 @@ private function getRequestOptionsResolver()
420420
->setAllowedValues('locale', ['FR', 'EN', 'DE', 'IT', 'ES', 'NL', 'PT'])
421421
->setNormalizer('schedule', function (
422422
/** @noinspection PhpUnusedParameterInspection */
423-
Options $options, $value
423+
Options $options,
424+
$value
424425
) use ($scheduleResolver) {
425426
$schedule = [];
426427

Diff for: src/MoneticoGatewayFactory.php

+16-16
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,20 @@ protected function populateConfig(ArrayObject $config)
4444
'payum.action.sync' => new Action\SyncAction(),
4545

4646
'payum.action.api.payment_response' => new Action\Api\PaymentResponseAction(),
47-
'payum.action.api.payment_form' => function (ArrayObject $config) {
47+
'payum.action.api.payment_form' => function (ArrayObject $config) {
4848
return new Action\Api\PaymentFormAction($config['payum.template.api_request']);
4949
},
5050
]);
5151

5252
if (false == $config['payum.api']) {
53-
$config['payum.default_options'] = array(
54-
'bank' => null,
55-
'mode' => null,
56-
'tpe' => null,
57-
'key' => null,
58-
'company' => null,
59-
'debug' => false,
60-
);
53+
$config['payum.default_options'] = [
54+
'bank' => null,
55+
'mode' => null,
56+
'tpe' => null,
57+
'key' => null,
58+
'company' => null,
59+
'debug' => false,
60+
];
6161

6262
$config->defaults($config['payum.default_options']);
6363
$config['payum.required_options'] = ['bank', 'mode', 'tpe', 'key', 'company'];
@@ -68,20 +68,20 @@ protected function populateConfig(ArrayObject $config)
6868
$api = new Api\Api();
6969

7070
$api->setConfig([
71-
'bank' => $config['bank'],
72-
'mode' => $config['mode'],
73-
'tpe' => $config['tpe'],
74-
'key' => $config['key'],
75-
'company' => $config['company'],
76-
'debug' => $config['debug'],
71+
'bank' => $config['bank'],
72+
'mode' => $config['mode'],
73+
'tpe' => $config['tpe'],
74+
'key' => $config['key'],
75+
'company' => $config['company'],
76+
'debug' => $config['debug'],
7777
]);
7878

7979
return $api;
8080
};
8181
}
8282

8383
$config['payum.paths'] = array_replace([
84-
'EkynaPayumMonetico' => __DIR__.'/Resources/views',
84+
'EkynaPayumMonetico' => __DIR__ . '/Resources/views',
8585
], $config['payum.paths'] ?: []);
8686
}
8787
}

Diff for: tests/Action/Api/PaymentFormActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PaymentFormActionTest extends AbstractActionTest
1616
{
1717
protected $requestClass = PaymentForm::class;
1818

19-
protected $actionClass = PaymentFormAction::class;
19+
protected $actionClass = PaymentFormAction::class;
2020

2121

2222
protected function setUp()

Diff for: tests/Action/Api/PaymentResponseActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PaymentResponseActionTest extends AbstractActionTest
1616
{
1717
protected $requestClass = PaymentResponse::class;
1818

19-
protected $actionClass = PaymentResponseAction::class;
19+
protected $actionClass = PaymentResponseAction::class;
2020

2121
/**
2222
* @test

Diff for: tests/Action/CaptureActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CaptureActionTest extends AbstractActionTest
1616
{
1717
protected $requestClass = Capture::class;
1818

19-
protected $actionClass = CaptureAction::class;
19+
protected $actionClass = CaptureAction::class;
2020

2121

2222
/**

Diff for: tests/Action/ConvertPaymentActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ConvertPaymentActionTest extends AbstractActionTest
1616
{
1717
protected $requestClass = Convert::class;
1818

19-
protected $actionClass = ConvertPaymentAction::class;
19+
protected $actionClass = ConvertPaymentAction::class;
2020

2121

2222
/**

Diff for: tests/Action/NotifyActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class NotifyActionTest extends AbstractActionTest
1515
{
1616
protected $requestClass = Notify::class;
1717

18-
protected $actionClass = NotifyAction::class;
18+
protected $actionClass = NotifyAction::class;
1919

2020

2121
/**

Diff for: tests/Action/StatusActionTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class StatusActionTest extends AbstractActionTest
1313
{
1414
protected $requestClass = GetHumanStatus::class;
1515

16-
protected $actionClass = StatusAction::class;
16+
protected $actionClass = StatusAction::class;
1717

1818

1919
/**
@@ -56,7 +56,7 @@ public function should_mark_captured_if_code_is_paiement()
5656
{
5757
$action = new StatusAction();
5858
$request = new GetHumanStatus([
59-
'code-retour' => 'paiement'
59+
'code-retour' => 'paiement',
6060
]);
6161

6262
$action->execute($request);
@@ -71,7 +71,7 @@ public function should_mark_captured_if_code_is_payetest()
7171
{
7272
$action = new StatusAction();
7373
$request = new GetHumanStatus([
74-
'code-retour' => 'payetest'
74+
'code-retour' => 'payetest',
7575
]);
7676

7777
$action->execute($request);
@@ -86,7 +86,7 @@ public function should_mark_failed_if_code_is_Annulation()
8686
{
8787
$action = new StatusAction();
8888
$request = new GetHumanStatus([
89-
'code-retour' => 'Annulation'
89+
'code-retour' => 'Annulation',
9090
]);
9191

9292
$action->execute($request);
@@ -101,7 +101,7 @@ public function should_mark_unknown_if_unexpected_code()
101101
{
102102
$action = new StatusAction();
103103
$request = new GetHumanStatus([
104-
'code-retour' => 'abracadabra'
104+
'code-retour' => 'abracadabra',
105105
]);
106106

107107
$action->execute($request);

Diff for: tests/Action/SyncActionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SyncActionTest extends AbstractActionTest
1515
{
1616
protected $requestClass = Sync::class;
1717

18-
protected $actionClass = SyncAction::class;
18+
protected $actionClass = SyncAction::class;
1919

2020

2121
/**

0 commit comments

Comments
 (0)