Skip to content

Commit 8649581

Browse files
committed
Code Update & Reformat
1 parent 8418265 commit 8649581

File tree

65 files changed

+6324
-6210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+6324
-6210
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ composer.phar
1515
# PHPUnit cache
1616
.phpunit.result.cache
1717
composer.lock
18-
/.env
19-
/doc/
18+
/.env

.openapi-generator/FILES

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,3 @@ lib/Model/TransactionList.php
6060
lib/Model/TransactionListTransactionsInner.php
6161
lib/ObjectSerializer.php
6262
phpunit.xml.dist
63-
test/Api/DefaultApiTest.php
64-
test/Model/AccountBalanceTest.php
65-
test/Model/AccountCurrencyExchangeTest.php
66-
test/Model/AccountRelatedAgentsTest.php
67-
test/Model/AccountTest.php
68-
test/Model/GetAccounts400ResponseTest.php
69-
test/Model/GetAccounts403ResponseTest.php
70-
test/Model/GetAccounts404ResponseTest.php
71-
test/Model/GetAccounts405ResponseTest.php
72-
test/Model/GetAccounts412ResponseTest.php
73-
test/Model/GetAccounts429ResponseTest.php
74-
test/Model/GetAccounts500ResponseTest.php
75-
test/Model/GetAccounts503ResponseTest.php
76-
test/Model/GetStatements400ResponseTest.php
77-
test/Model/GetStatements403ResponseTest.php
78-
test/Model/GetStatements404ResponseTest.php
79-
test/Model/GetTransactions400ResponseTest.php
80-
test/Model/GetTransactions401ResponseTest.php
81-
test/Model/GetTransactions404ResponseTest.php
82-
test/Model/StatementListAccountStatementsInnerPeriodTest.php
83-
test/Model/StatementListAccountStatementsInnerTest.php
84-
test/Model/StatementListTest.php
85-
test/Model/TransactionListTest.php
86-
test/Model/TransactionListTransactionsInnerTest.php
Lines changed: 101 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,106 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
4-
* @generated
5-
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
614
*/
7-
$finder = PhpCsFixer\Finder::create()
8-
->in(__DIR__)
9-
->exclude('vendor')
10-
->exclude('test')
11-
->exclude('tests')
12-
;
13-
14-
$config = new PhpCsFixer\Config();
15-
return $config->setRules([
16-
'@PSR12' => true,
17-
'phpdoc_order' => true,
18-
'array_syntax' => [ 'syntax' => 'short' ],
19-
'strict_comparison' => true,
20-
'strict_param' => true,
21-
'no_trailing_whitespace' => false,
22-
'no_trailing_whitespace_in_comment' => false,
23-
'single_space_around_construct' => true,
24-
'single_blank_line_at_eof' => false,
25-
'blank_line_after_namespace' => false,
26-
'no_leading_import_slash' => false,
15+
16+
use Ergebnis\PhpCsFixer\Config\Factory;
17+
use Ergebnis\PhpCsFixer\Config\Rules;
18+
use Ergebnis\PhpCsFixer\Config\RuleSet\Php74;
19+
20+
$header = <<<'HEADER'
21+
This file is part of the CsasWebApi package
22+
23+
https://github.com/Spoje-NET/php-csas-webapi
24+
25+
(c) SpojeNetIT <http://spoje.net/>
26+
27+
For the full copyright and license information, please view the LICENSE
28+
file that was distributed with this source code.
29+
HEADER;
30+
31+
$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([
32+
'blank_line_before_statement' => [
33+
'statements' => [
34+
'break',
35+
'continue',
36+
'declare',
37+
'default',
38+
'do',
39+
'exit',
40+
'for',
41+
'foreach',
42+
'goto',
43+
'if',
44+
'include',
45+
'include_once',
46+
'require',
47+
'require_once',
48+
'return',
49+
'switch',
50+
'throw',
51+
'try',
52+
'while',
53+
],
54+
],
55+
'concat_space' => [
56+
'spacing' => 'none',
57+
],
58+
'date_time_immutable' => false,
59+
'error_suppression' => false,
60+
'final_class' => false,
61+
'mb_str_functions' => false,
62+
'native_function_invocation' => [
63+
'exclude' => [
64+
'sprintf',
65+
],
66+
'include' => [
67+
'@compiler_optimized',
68+
],
69+
'scope' => 'all',
70+
'strict' => false,
71+
],
72+
'php_unit_internal_class' => false,
73+
'php_unit_test_annotation' => [
74+
'style' => 'prefix',
75+
],
76+
'php_unit_test_class_requires_covers' => false,
77+
'return_to_yield_from' => false,
78+
'phpdoc_array_type' => false,
79+
'phpdoc_list_type' => false,
80+
'attribute_empty_parentheses' => false,
81+
'final_public_method_for_abstract_class' => false,
82+
'class_attributes_separation' => [
83+
'elements' => [
84+
'const' => 'only_if_meta',
85+
'property' => 'only_if_meta',
86+
'trait_import' => 'none',
87+
'case' => 'none',
88+
],
89+
],
90+
'yoda_style' => false,
91+
'php_unit_test_case_static_method_calls' => false,
92+
]));
93+
94+
$config = Factory::fromRuleSet($ruleSet);
95+
96+
$config->getFinder()
97+
->append([
98+
__DIR__.'/.php-cs-fixer.dist.php',
2799
])
28-
->setFinder($finder)
29-
;
100+
->in('Examples')
101+
->in('lib')
102+
->in('test');
103+
104+
$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache');
105+
106+
return $config;

.openapi-generator/templates/Configuration.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class Configuration
395395
*/
396396
public static function getDefaultConfiguration()
397397
{
398-
if (self::$defaultConfiguration === null) {
398+
if (isset(self::$defaultConfiguration) === false) {
399399
self::$defaultConfiguration = new Configuration();
400400
}
401401

.openapi-generator/templates/composer.mustache

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@
3737
"vitexsoftware/ease-core": "^1.45"
3838
},
3939
"require-dev": {
40-
"phpunit/phpunit": "^8.0 || ^9.0",
41-
"friendsofphp/php-cs-fixer": "^3.5"
40+
"phpunit/phpunit": "*",
41+
"phpstan/phpstan": "*",
42+
"friendsofphp/php-cs-fixer": "^3.61",
43+
"ergebnis/composer-normalize": "^2.43",
44+
"ergebnis/php-cs-fixer-config": "^6.34",
45+
"phpstan/phpstan-phpunit": "2.0.x-dev"
4246
},
4347
"autoload": {
4448
"psr-4": {
@@ -55,9 +59,14 @@
5559
}
5660
},
5761
"scripts": {
58-
"pre-update-cmd": [
62+
"regenerate": [
5963
"npx openapi-generator-cli generate -i openapi.yml -g php --git-user-id Spoje-NET --git-repo-id php-csas-webapi -c .openapi-generator/config.yaml",
6064
"vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose --allow-risky=yes"
6165
]
66+
},
67+
"config": {
68+
"allow-plugins": {
69+
"ergebnis/composer-normalize": true
70+
}
6271
}
6372
}

.php-cs-fixer.dist.php

Lines changed: 101 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,106 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
/**
4-
* @generated
5-
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/HEAD/doc/config.rst
6+
* This file is part of the CsasWebApi package
7+
*
8+
* https://github.com/Spoje-NET/php-csas-webapi
9+
*
10+
* (c) SpojeNetIT <http://spoje.net/>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
614
*/
7-
$finder = PhpCsFixer\Finder::create()
8-
->in(__DIR__)
9-
->exclude('vendor')
10-
->exclude('test')
11-
->exclude('tests')
12-
;
13-
14-
$config = new PhpCsFixer\Config();
15-
return $config->setRules([
16-
'@PSR12' => true,
17-
'phpdoc_order' => true,
18-
'array_syntax' => [ 'syntax' => 'short' ],
19-
'strict_comparison' => true,
20-
'strict_param' => true,
21-
'no_trailing_whitespace' => false,
22-
'no_trailing_whitespace_in_comment' => false,
23-
'single_space_around_construct' => true,
24-
'single_blank_line_at_eof' => false,
25-
'blank_line_after_namespace' => false,
26-
'no_leading_import_slash' => false,
15+
16+
use Ergebnis\PhpCsFixer\Config\Factory;
17+
use Ergebnis\PhpCsFixer\Config\Rules;
18+
use Ergebnis\PhpCsFixer\Config\RuleSet\Php74;
19+
20+
$header = <<<'HEADER'
21+
This file is part of the CsasWebApi package
22+
23+
https://github.com/Spoje-NET/php-csas-webapi
24+
25+
(c) SpojeNetIT <http://spoje.net/>
26+
27+
For the full copyright and license information, please view the LICENSE
28+
file that was distributed with this source code.
29+
HEADER;
30+
31+
$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([
32+
'blank_line_before_statement' => [
33+
'statements' => [
34+
'break',
35+
'continue',
36+
'declare',
37+
'default',
38+
'do',
39+
'exit',
40+
'for',
41+
'foreach',
42+
'goto',
43+
'if',
44+
'include',
45+
'include_once',
46+
'require',
47+
'require_once',
48+
'return',
49+
'switch',
50+
'throw',
51+
'try',
52+
'while',
53+
],
54+
],
55+
'concat_space' => [
56+
'spacing' => 'none',
57+
],
58+
'date_time_immutable' => false,
59+
'error_suppression' => false,
60+
'final_class' => false,
61+
'mb_str_functions' => false,
62+
'native_function_invocation' => [
63+
'exclude' => [
64+
'sprintf',
65+
],
66+
'include' => [
67+
'@compiler_optimized',
68+
],
69+
'scope' => 'all',
70+
'strict' => false,
71+
],
72+
'php_unit_internal_class' => false,
73+
'php_unit_test_annotation' => [
74+
'style' => 'prefix',
75+
],
76+
'php_unit_test_class_requires_covers' => false,
77+
'return_to_yield_from' => false,
78+
'phpdoc_array_type' => false,
79+
'phpdoc_list_type' => false,
80+
'attribute_empty_parentheses' => false,
81+
'final_public_method_for_abstract_class' => false,
82+
'class_attributes_separation' => [
83+
'elements' => [
84+
'const' => 'only_if_meta',
85+
'property' => 'only_if_meta',
86+
'trait_import' => 'none',
87+
'case' => 'none',
88+
],
89+
],
90+
'yoda_style' => false,
91+
'php_unit_test_case_static_method_calls' => false,
92+
]));
93+
94+
$config = Factory::fromRuleSet($ruleSet);
95+
96+
$config->getFinder()
97+
->append([
98+
__DIR__.'/.php-cs-fixer.dist.php',
2799
])
28-
->setFinder($finder)
29-
;
100+
->in('Examples')
101+
->in('lib')
102+
->in('test');
103+
104+
$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache');
105+
106+
return $config;

Examples/accounts.php

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of the CsasWebApi package
7+
*
8+
* https://github.com/Spoje-NET/php-csas-webapi
9+
*
10+
* (c) SpojeNetIT <http://spoje.net/>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
316
use Ease\Shared as Shr;
417

5-
require_once dirname(__DIR__) . '/vendor/autoload.php';
18+
require_once \dirname(__DIR__).'/vendor/autoload.php';
619

7-
Shr::init([], dirname(__DIR__) . '/.env');
20+
Shr::init([], \dirname(__DIR__).'/.env');
821

922
$apiInstance = new \SpojeNET\Csas\Accounts\DefaultApi(new SpojeNET\Csas\ApiClient(
1023
[
11-
'apikey' => Shr::cfg('API_KEY'),
12-
'token' => Shr::cfg('API_TOKEN'),
13-
'debug' => Shr::cfg('API_DEBUG', false),
14-
'sandbox' => Shr::cfg('SANDBOX_MODE')
15-
]
24+
'apikey' => Shr::cfg('API_KEY'),
25+
'token' => Shr::cfg('API_TOKEN'),
26+
'debug' => Shr::cfg('API_DEBUG', false),
27+
'sandbox' => Shr::cfg('SANDBOX_MODE'),
28+
],
1629
));
1730

1831
try {
1932
$result = $apiInstance->getAccounts();
2033
print_r($result);
2134
} catch (Exception $e) {
22-
echo 'Exception when calling DefaultApi->getAccounts: ', $e->getMessage(), PHP_EOL;
35+
echo 'Exception when calling DefaultApi->getAccounts: ', $e->getMessage(), \PHP_EOL;
2336
}

0 commit comments

Comments
 (0)