Skip to content

Commit 0f9c696

Browse files
authored
Merge pull request #4 from VitexSoftware/php81_spec1.1.20240910
Php81 spec1.1.20240910
2 parents e209d21 + cb73182 commit 0f9c696

File tree

69 files changed

+5861
-5240
lines changed

Some content is hidden

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

69 files changed

+5861
-5240
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ composer.phar
2929
/.phpdoc/
3030
/.env
3131
/node_modules/
32+
/debian/files

.openapi-generator/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ additionalProperties:
1111
invokerPackage: VitexSoftware\Raiffeisenbank
1212
modelPackage: Model
1313
variableNamingConvention: camelCase
14+
composerPackageName: vitexsoftware/rbczpremiumapi
1415
files:
1516
AUTHORS.md: {}
1617
composer.json: {}
Lines changed: 92 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,95 @@
11
<?php
22

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

.openapi-generator/templates/ApiClient.mustache

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @author Vitex <vitex@hippy.cz>
77
* @copyright 2023 Vitex@hippy.cz (G)
88
*
9-
* PHP 7
9+
* PHP 8
1010
*/
1111

1212
namespace VitexSoftware\Raiffeisenbank;
@@ -23,7 +23,7 @@ class ApiClient extends \GuzzleHttp\Client
2323
* ClientID obtained from Developer Portal - when you registered your app with us.
2424
* @var string
2525
*/
26-
protected $xIBMClientId = null;
26+
protected string $xIBMClientId = '';
2727
2828
/**
2929
* the end IP address of the client application (no server) in IPv4 or IPv6
@@ -34,13 +34,13 @@ class ApiClient extends \GuzzleHttp\Client
3434
*
3535
* @var string
3636
*/
37-
protected $pSUIPAddress = null;
37+
protected string $pSUIPAddress = '';
3838
3939
/**
4040
* Use mocking for api calls ?
4141
* @var boolean
4242
*/
43-
protected $mockMode = false;
43+
protected bool $mockMode = false;
4444
4545
/**
4646
* @inheritDoc
@@ -76,11 +76,11 @@ class ApiClient extends \GuzzleHttp\Client
7676
$config['debug'] = \Ease\Shared::cfg('API_DEBUG', false);
7777
}
7878

79-
if(array_key_exists('clientpubip', $config)){
79+
if (array_key_exists('clientpubip', $config)){
8080
$this->pSUIPAddress = $config['clientpubip'];
8181
}
8282

83-
if(array_key_exists('mocking', $config)){
83+
if (array_key_exists('mocking', $config)){
8484
$this->mockMode = boolval($config['mocking']);
8585
}
8686

@@ -163,7 +163,7 @@ class ApiClient extends \GuzzleHttp\Client
163163
if ((file_exists($certFile) === false) || (is_readable($certFile) === false)) {
164164
$errMsg = 'Cannot read specified certificate file: ' . $certFile;
165165
fwrite(STDERR, $errMsg . PHP_EOL);
166-
if($die){
166+
if ($die){
167167
throw new \Exception($errMsg);
168168
}
169169
} else {
@@ -173,7 +173,7 @@ class ApiClient extends \GuzzleHttp\Client
173173
}
174174

175175
public static function checkCertificate($certFile,$password): bool {
176-
return self::checkCertificatePresence($certFile) && self::checkCertificatePassword( $certFile,$password);
176+
return self::checkCertificatePresence($certFile) && self::checkCertificatePassword($certFile,$password);
177177
}
178178

179179
public static function checkCertificatePassword(string $certFile, string $password): bool {

.openapi-generator/templates/ApiException.mustache

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* ApiException
5-
* PHP version 7.4+
5+
* PHP version 8.1+
66
*
77
* @category Class
88
* @package {{invokerPackage}}
@@ -46,11 +46,9 @@ class ApiException extends Exception
4646
protected $responseHeaders;
4747
4848
/**
49-
* The deserialized response object
50-
*
51-
* @var \stdClass|string|null
49+
* The deserialized response object.
5250
*/
53-
protected $responseObject;
51+
protected null|\stdClass|string|array $responseObject;
5452
5553
/**
5654
* Constructor

.openapi-generator/templates/Configuration.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Configuration
5-
* PHP version 7.4+
5+
* PHP version 8.1+
66
*
77
* @category Class
88
* @package {{invokerPackage}}
@@ -395,8 +395,8 @@ class Configuration
395395
*/
396396
public static function getDefaultConfiguration()
397397
{
398-
if (self::$defaultConfiguration === null) {
399-
self::$defaultConfiguration = new Configuration();
398+
if (isset(self::$defaultConfiguration) === false) {
399+
self::$defaultConfiguration = new self();
400400
}
401401

402402
return self::$defaultConfiguration;

.openapi-generator/templates/Transactor.mustache

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,13 @@ class Transactor extends ApiClient
164164
$this->setDataValue('paymentAccount', ['accountNo' => $accountNumber, 'bankCode' => $counterAccount->organisationIdentification->bankCode]);
165165

166166
$amount = strval(abs($transactionData->amount->value));
167-
if ($transactionData->amount->currency == 'CZK') {
167+
if ($transactionData->amount->currency === 'CZK') {
168168
$this->setDataValue('homeCurrency', ['priceNone' => $amount]);
169169
} else {
170170
$this->setDataValue('foreginCurrency', ['priceNone' => $amount]); //TODO: Not tested
171171
}
172172
}
173173

174-
// $this->setDataValue('source', $this->sourceString());
175-
// echo $this->getJsonizedData() . "\n";
176174
}
177175

178176
/**

0 commit comments

Comments
 (0)