Skip to content

Commit e9eeb13

Browse files
author
Vítězslav Dvořák
committed
statementor setScope return fix
1 parent a285d89 commit e9eeb13

4 files changed

Lines changed: 37 additions & 26 deletions

File tree

.openapi-generator/templates/Statementor.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @category Class
77
* @package {{invokerPackage}}
88
* @author Vítězslav Dvořák <info@vitexsoftware.com>
9-
* @copyright (C) 2023-2024 VitexSoftware.com
9+
* @copyright (C) 2023-2025 VitexSoftware.com
1010
*/
1111

1212
namespace VitexSoftware\Raiffeisenbank;
@@ -206,6 +206,7 @@ class Statementor extends \Ease\Sand
206206
$this->since = $this->since->setTime(0, 0);
207207
$this->until = $this->until->setTime(23, 59, 59, 999);
208208
}
209+
return new \DatePeriod($this->since, new \DateInterval('P1D'), $this->until);
209210
}
210211

211212
/**

.openapi-generator/templates/api.mustache

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ use {{invokerPackage}}\ObjectSerializer;
188188

189189
{{#operation}}
190190
/**
191-
* Operation {{{operationId}}}
191+
* Operation {{{operationId}}}.
192192
{{#summary}}
193193
*
194194
* {{.}}
@@ -339,12 +339,12 @@ use {{invokerPackage}}\ObjectSerializer;
339339
$content = (string) $response->getBody();
340340
if ('{{{dataType}}}' !== 'string') {
341341
try {
342-
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
342+
$content = json_decode($content, false, 512, \JSON_THROW_ON_ERROR);
343343
} catch (\JsonException $exception) {
344344
throw new ApiException(
345345
sprintf(
346346
'Error JSON decoding server response (%s)',
347-
$request->getUri()
347+
$request->getUri(),
348348
),
349349
$statusCode,
350350
$response->getHeaders(),
@@ -357,7 +357,7 @@ use {{invokerPackage}}\ObjectSerializer;
357357
return [
358358
ObjectSerializer::deserialize($content, '{{{dataType}}}', []),
359359
$response->getStatusCode(),
360-
$response->getHeaders()
360+
$response->getHeaders(),
361361
];{{/isRange}}
362362
{{/dataType}}
363363
{{#-last}}
@@ -370,31 +370,31 @@ use {{invokerPackage}}\ObjectSerializer;
370370
sprintf(
371371
'[%d] Error connecting to the API (%s)',
372372
$statusCode,
373-
(string) $request->getUri()
373+
(string) $request->getUri(),
374374
),
375375
$statusCode,
376376
$response->getHeaders(),
377-
(string) $response->getBody()
377+
(string) $response->getBody(),
378378
);
379379
}
380380

381381
$returnType = '{{{returnType}}}';
382382
if ($returnType === '\SplFileObject') {
383-
$content = $response->getBody(); //stream goes to serializer
383+
$content = $response->getBody(); // stream goes to serializer
384384
} else {
385385
$content = (string) $response->getBody();
386386
if ($returnType !== 'string') {
387387
try {
388-
$content = json_decode($content, false, 512, JSON_THROW_ON_ERROR);
388+
$content = json_decode($content, false, 512, \JSON_THROW_ON_ERROR);
389389
} catch (\JsonException $exception) {
390390
throw new ApiException(
391391
sprintf(
392392
'Error JSON decoding server response (%s)',
393-
$request->getUri()
393+
$request->getUri(),
394394
),
395395
$statusCode,
396396
$response->getHeaders(),
397-
$content
397+
$content,
398398
);
399399
}
400400
}
@@ -419,9 +419,10 @@ use {{invokerPackage}}\ObjectSerializer;
419419
$data = ObjectSerializer::deserialize(
420420
$e->getResponseBody(),
421421
'{{{dataType}}}',
422-
$e->getResponseHeaders()
422+
$e->getResponseHeaders(),
423423
);
424424
$e->setResponseObject($data);
425+
425426
break;{{/isRange}}
426427
{{/dataType}}
427428
{{/responses}}
@@ -662,12 +663,12 @@ use {{invokerPackage}}\ObjectSerializer;
662663
{{/required}}
663664
{{#hasValidation}}
664665
{{#maxLength}}
665-
if ({{^required}}${{paramName}} !== null && {{/required}}strlen((string)${{paramName}}) > {{maxLength}}) {
666+
if ({{^required}}${{paramName}} !== null && {{/required}}\strlen((string) ${{paramName}}) > {{maxLength}}) {
666667
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be smaller than or equal to {{maxLength}}.');
667668
}
668669
{{/maxLength}}
669670
{{#minLength}}
670-
if ({{^required}}${{paramName}} !== null && {{/required}}strlen((string)${{paramName}}) < {{minLength}}) {
671+
if ({{^required}}${{paramName}} !== null && {{/required}}\strlen((string) ${{paramName}}) < {{minLength}}) {
671672
throw new \InvalidArgumentException('invalid length for "${{paramName}}" when calling {{classname}}.{{operationId}}, must be bigger than or equal to {{minLength}}.');
672673
}
673674
{{/minLength}}
@@ -716,7 +717,7 @@ use {{invokerPackage}}\ObjectSerializer;
716717
'{{#schema}}{{openApiType}}{{/schema}}', // openApiType
717718
'{{style}}', // style
718719
{{#isExplode}}true{{/isExplode}}{{^isExplode}}false{{/isExplode}}, // explode
719-
{{required}} // required
720+
{{required}}, // required
720721
) ?? []);
721722
{{/queryParams}}
722723

@@ -741,7 +742,7 @@ use {{invokerPackage}}\ObjectSerializer;
741742
{{/collectionFormat}}
742743
if (${{paramName}} !== null) {
743744
$resourcePath = str_replace(
744-
'{' . '{{baseName}}' . '}',
745+
'{'.'{{baseName}}'.'}',
745746
ObjectSerializer::toPathValue(${{paramName}}),
746747
$resourcePath
747748
);
@@ -781,15 +782,15 @@ use {{invokerPackage}}\ObjectSerializer;
781782
{{#bodyParams}}
782783
if (isset(${{paramName}})) {
783784
if (stripos($headers['Content-Type'], 'application/json') !== false) {
784-
# if Content-Type contains "application/json", json_encode the body
785+
// if Content-Type contains "application/json", json_encode the body
785786
$httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization(${{paramName}}));
786787
} else {
787788
$httpBody = ${{paramName}};
788789
}
789790
} elseif (count($formParams) > 0) {
790791
{{/bodyParams}}
791792
{{^bodyParams}}
792-
if (count($formParams) > 0) {
793+
if (\count($formParams) > 0) {
793794
{{/bodyParams}}
794795
if ($multipart) {
795796
$multipartContents = [];
@@ -806,7 +807,7 @@ use {{invokerPackage}}\ObjectSerializer;
806807
$httpBody = new MultipartStream($multipartContents);
807808

808809
} elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
809-
# if Content-Type contains "application/json", json_encode the form parameters
810+
// if Content-Type contains "application/json", json_encode the form parameters
810811
$httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
811812
} else {
812813
// for HTTP post (form)
@@ -826,20 +827,20 @@ use {{invokerPackage}}\ObjectSerializer;
826827
{{#isBasicBasic}}
827828
// this endpoint requires HTTP basic authentication
828829
if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {
829-
$headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword());
830+
$headers['Authorization'] = 'Basic '.base64_encode($this->config->getUsername().":".$this->config->getPassword());
830831
}
831832
{{/isBasicBasic}}
832833
{{#isBasicBearer}}
833834
// this endpoint requires Bearer{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} authentication (access token)
834835
if (!empty($this->config->getAccessToken())) {
835-
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
836+
$headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();
836837
}
837838
{{/isBasicBearer}}
838839
{{/isBasic}}
839840
{{#isOAuth}}
840841
// this endpoint requires OAuth (access token)
841842
if (!empty($this->config->getAccessToken())) {
842-
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
843+
$headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();
843844
}
844845
{{/isOAuth}}
845846
{{/authMethods}}
@@ -852,7 +853,7 @@ use {{invokerPackage}}\ObjectSerializer;
852853
$headers = array_merge(
853854
$defaultHeaders,
854855
$headerParams,
855-
$headers
856+
$headers,
856857
);
857858

858859
{{#servers.0}}
@@ -874,9 +875,9 @@ use {{invokerPackage}}\ObjectSerializer;
874875
$query = ObjectSerializer::buildQuery($queryParams);
875876
return new Request(
876877
'{{httpMethod}}',
877-
$operationHost . $resourcePath . ($query ? "?{$query}" : ''),
878+
$operationHost.$resourcePath.($query ? "?{$query}" : ''),
878879
$headers,
879-
$httpBody
880+
$httpBody,
880881
);
881882
}
882883

debian/changelog

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
php-vitexsoftware-rbczpremiumapi (1.3.1) UNRELEASED; urgency=medium
22

3+
* SetScope return value fix
4+
5+
-- Vitex <vitezslav.dvorak@spojenet.cz> Tue, 11 Mar 2025 11:18:13 +0100
6+
7+
php-vitexsoftware-rbczpremiumapi (1.3.1) unstable; urgency=medium
8+
9+
[ vitex ]
310
* 2025 update
411

5-
-- vitex <info@vitexsoftware.cz> Mon, 10 Mar 2025 14:25:03 +0100
12+
-- Vitex <vitezslav.dvorak@spojenet.cz> Tue, 11 Mar 2025 11:17:57 +0100
613

714
php-vitexsoftware-rbczpremiumapi (1.3.0) unstable; urgency=medium
815

lib/Statementor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ public function setScope($scope): \DatePeriod
209209
$this->since = $this->since->setTime(0, 0);
210210
$this->until = $this->until->setTime(23, 59, 59, 999);
211211
}
212+
213+
return new \DatePeriod($this->since, new \DateInterval('P1D'), $this->until);
212214
}
213215

214216
/**

0 commit comments

Comments
 (0)