Skip to content

Commit 34ccb68

Browse files
authored
Merge pull request #748 from Adyen/support-explicit-nullable
Add nullable return types to API mustache templates
2 parents b61f85e + 3c6c0a8 commit 34ccb68

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
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_parameters.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
{{! Path and body are required, followed by optional query string and request options }}
2-
{{#pathParams}}{{{dataType}}} ${{baseName}}, {{/pathParams}}{{#bodyParams}}{{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}, {{/bodyParams}}array $requestOptions = null
2+
{{#pathParams}}{{{dataType}}} ${{baseName}}, {{/pathParams}}{{#bodyParams}}{{{dataType}}} ${{#lambda.camelcase}}{{paramName}}{{/lambda.camelcase}}, {{/bodyParams}}?array $requestOptions = null

templates/model_generic.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}}{{/parentSchema}}{{^par
239239
* @param mixed[] $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)