Skip to content

Commit 9a412fc

Browse files
committed
Add support for explicit nullable 8.1+
1 parent 38458a1 commit 9a412fc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/Adyen/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Config
3434
*
3535
* @param array|null $params
3636
*/
37-
public function __construct(array $params = null)
37+
public function __construct(?array $params = null)
3838
{
3939
if ($params) {
4040
foreach ($params as $key => $param) {

templates/api-single.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class {{customApi}}Api extends Service
5252
{{#returnType}}* @return {{returnType}}{{/returnType}}
5353
* @throws AdyenException
5454
*/
55-
public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: {{{.}}}{{/returnType}}
55+
public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: ?{{{.}}}{{/returnType}}
5656
{
5757
$endpoint = $this->baseURL . {{#hasPathParams}}str_replace([{{#pathParams}}'{{>left_bracket}}{{baseName}}{{>right_bracket}}'{{^-last}}, {{/-last}}{{/pathParams}}], [{{#pathParams}}${{baseName}}{{^-last}}, {{/-last}}{{/pathParams}}], {{/hasPathParams}}"{{{path}}}"{{#hasPathParams}}){{/hasPathParams}};
5858
{{#returnType}}$response = {{/returnType}}$this->requestHttp($endpoint, strtolower('{{httpMethod}}'), {{#bodyParam}}(array) ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}->jsonSerialize(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, $requestOptions);

templates/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class {{classname}} extends Service
5353
{{#returnType}}* @return {{returnType}}{{/returnType}}
5454
* @throws AdyenException
5555
*/
56-
public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: {{{.}}}{{/returnType}}
56+
public function {{#lambda.camelcase}}{{vendorExtensions.x-methodName}}{{/lambda.camelcase}}({{>api_parameters}}){{#returnType}}: ?{{{.}}}{{/returnType}}
5757
{
5858
$endpoint = $this->baseURL . {{#hasPathParams}}str_replace([{{#pathParams}}'{{>left_bracket}}{{baseName}}{{>right_bracket}}'{{^-last}}, {{/-last}}{{/pathParams}}], [{{#pathParams}}${{baseName}}{{^-last}}, {{/-last}}{{/pathParams}}], {{/hasPathParams}}"{{{path}}}"{{#hasPathParams}}){{/hasPathParams}};
5959
{{#returnType}}$response = {{/returnType}}$this->requestHttp($endpoint, strtolower('{{httpMethod}}'), {{#bodyParam}}(array) ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}->jsonSerialize(){{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}, $requestOptions);

templates/model_generic.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
236236
/**
237237
* Constructor
238238
*
239-
* @param mixed[] $data Associated array of property values
239+
* @param mixed[]|null $data Associated array of property values
240240
* initializing the model
241241
*/
242-
public function __construct(array $data = null)
242+
public function __construct(?array $data = null)
243243
{
244244
{{#parentSchema}}
245245
parent::__construct($data);

0 commit comments

Comments
 (0)