Skip to content

Commit 0fab93c

Browse files
committed
Strict Types update
Code reformat
1 parent badc593 commit 0fab93c

14 files changed

Lines changed: 118 additions & 118 deletions

.openapi-generator/templates/Statementor.mustache

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class Statementor extends \Ease\Sand
4242
if ($accountNumber) {
4343
$this->setAccountNumber($accountNumber);
4444
}
45-
46-
if ($scope){
45+
46+
if ($scope) {
4747
$this->setScope($scope);
4848
}
49-
49+
5050
}
5151

5252
/**
@@ -71,7 +71,7 @@ class Statementor extends \Ease\Sand
7171
*
7272
* @return array
7373
*/
74-
public function getStatements($currencyCode = 'CZK', $statementLine = 'MAIN')
74+
public function getStatements($currencyCode = 'CZK', $statementLine = 'MAIN'): array
7575
{
7676
$apiInstance = new PremiumAPI\GetStatementListApi();
7777
$page = 0;
@@ -213,13 +213,13 @@ class Statementor extends \Ease\Sand
213213
* Save Statement PDF files
214214
*
215215
* @param string $saveTo
216-
* @param array $statements
216+
* @param array<mixed> $statements - produced by getStatements() function
217217
* @param string $format pdf|xml
218218
* @param string $currencyCode
219219
*
220-
* @return string
220+
* @return array
221221
*/
222-
public function download(string $saveTo, array $statements, $format = 'pdf', $currencyCode = 'CZK')
222+
public function download(string $saveTo, array $statements, string $format = 'pdf', string $currencyCode = 'CZK'): array
223223
{
224224
$saved = [];
225225
$apiInstance = new PremiumAPI\DownloadStatementApi();
@@ -252,7 +252,7 @@ class Statementor extends \Ease\Sand
252252
*
253253
* @return \DateTime
254254
*/
255-
public function getSince()
255+
public function getSince(): \DateTime
256256
{
257257
return $this->since;
258258
}
@@ -262,7 +262,7 @@ class Statementor extends \Ease\Sand
262262
*
263263
* @return \DateTime
264264
*/
265-
public function getUntil()
265+
public function getUntil(): \DateTime
266266
{
267267
return $this->until;
268268
}

debian/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "deb/rbczpremiumapi",
33
"description": "An Core of PHP Framework for Ease of writing Applications (debianized)",
4-
"version": "1.2.2",
4+
"version": "1.2.3",
55
"authors": [
66
{
77
"name": "Vítězslav Dvořák",

examples/download-statements.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* Get today's transactions list
1515
*/
1616
\Ease\Shared::init(['CERT_PASS', 'XIBMCLIENTID', 'ACCOUNT_NUMBER'], isset($argv[1]) ? $argv[1] : '../.env');
17-
ApiClient::checkCertificatePresence(\Ease\Functions::cfg('CERT_FILE'));
18-
$engine = new Statementor(\Ease\Functions::cfg('ACCOUNT_NUMBER'));
19-
$engine->setScope(\Ease\Functions::cfg('STATEMENT_IMPORT_SCOPE', 'last_month'));
17+
ApiClient::checkCertificatePresence(\Ease\Shared::cfg('CERT_FILE'));
18+
$engine = new Statementor(\Ease\Shared::cfg('ACCOUNT_NUMBER'));
19+
$engine->setScope(\Ease\Shared::cfg('STATEMENT_IMPORT_SCOPE', 'last_month'));
2020

21-
$saveTo = \Ease\Functions::cfg('STATEMENT_SAVE_DIR', './');
21+
$saveTo = \Ease\Shared::cfg('STATEMENT_SAVE_DIR', './');
2222

2323
if (file_exists($saveTo) === false) {
2424
mkdir($saveTo, 0777, true);

lib/ApiClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ public static function sourceString()
149149
/**
150150
* Try to check certificate readibilty
151151
*
152-
* @throws Exception - Certificate file not found
153152
*
154153
* @param string $certFile path to certificate
155154
* @param boolean $die throw exception or return false ?
155+
* @throws Exception - Certificate file not found
156156
*
157157
* @return boolean certificate file
158158
*/

lib/ObjectSerializer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ private static function isEmptyValue($value, string $openApiType): bool
193193
case 'float':
194194
return $value !== 0 && $value !== 0.0;
195195

196-
# For boolean values, '' is considered empty
196+
# For boolean values, '' is considered empty
197197
case 'bool':
198198
case 'boolean':
199199
return !in_array($value, [false, 0], true);
200200

201-
# For all the other types, any value at this point can be considered empty.
201+
# For all the other types, any value at this point can be considered empty.
202202
default:
203203
return true;
204204
}
@@ -239,7 +239,7 @@ public static function toQueryValue(
239239
}
240240

241241
# Handle DateTime objects in query
242-
if ( (($openApiType === "\\DateTime") || $openApiType === 'string') && $value instanceof \DateTime) {
242+
if ((($openApiType === "\\DateTime") || $openApiType === 'string') && $value instanceof \DateTime) {
243243
return ["{$paramName}" => $value->format(self::$dateTimeFormat)];
244244
}
245245

@@ -294,7 +294,7 @@ public static function toQueryValue(
294294
*/
295295
public static function convertBoolToQueryStringFormat(bool $value)
296296
{
297-
if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) {
297+
if (Configuration::BOOLEAN_FORMAT_STRING === Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) {
298298
return $value ? 'true' : 'false';
299299
}
300300

lib/PremiumAPI/DownloadStatementApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class DownloadStatementApi
9797
],
9898
];
9999

100-
/**
101-
* @param ClientInterface $client
102-
* @param Configuration $config
103-
* @param HeaderSelector $selector
104-
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105-
*/
100+
/**
101+
* @param ClientInterface $client
102+
* @param Configuration $config
103+
* @param HeaderSelector $selector
104+
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105+
*/
106106
public function __construct(
107107
ClientInterface $client = null,
108108
Configuration $config = null,

lib/PremiumAPI/GetAccountBalanceApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class GetAccountBalanceApi
9797
],
9898
];
9999

100-
/**
101-
* @param ClientInterface $client
102-
* @param Configuration $config
103-
* @param HeaderSelector $selector
104-
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105-
*/
100+
/**
101+
* @param ClientInterface $client
102+
* @param Configuration $config
103+
* @param HeaderSelector $selector
104+
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105+
*/
106106
public function __construct(
107107
ClientInterface $client = null,
108108
Configuration $config = null,

lib/PremiumAPI/GetAccountsApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class GetAccountsApi
9797
],
9898
];
9999

100-
/**
101-
* @param ClientInterface $client
102-
* @param Configuration $config
103-
* @param HeaderSelector $selector
104-
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105-
*/
100+
/**
101+
* @param ClientInterface $client
102+
* @param Configuration $config
103+
* @param HeaderSelector $selector
104+
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105+
*/
106106
public function __construct(
107107
ClientInterface $client = null,
108108
Configuration $config = null,

lib/PremiumAPI/GetBatchDetailApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class GetBatchDetailApi
9797
],
9898
];
9999

100-
/**
101-
* @param ClientInterface $client
102-
* @param Configuration $config
103-
* @param HeaderSelector $selector
104-
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105-
*/
100+
/**
101+
* @param ClientInterface $client
102+
* @param Configuration $config
103+
* @param HeaderSelector $selector
104+
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105+
*/
106106
public function __construct(
107107
ClientInterface $client = null,
108108
Configuration $config = null,

lib/PremiumAPI/GetStatementListApi.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ class GetStatementListApi
9797
],
9898
];
9999

100-
/**
101-
* @param ClientInterface $client
102-
* @param Configuration $config
103-
* @param HeaderSelector $selector
104-
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105-
*/
100+
/**
101+
* @param ClientInterface $client
102+
* @param Configuration $config
103+
* @param HeaderSelector $selector
104+
* @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec
105+
*/
106106
public function __construct(
107107
ClientInterface $client = null,
108108
Configuration $config = null,

0 commit comments

Comments
 (0)