From 5ec89410556142cc938b5eabacb9a553890290a1 Mon Sep 17 00:00:00 2001 From: Jan Vernieuwe Date: Fri, 25 Oct 2019 10:27:09 +0200 Subject: [PATCH] Fix getClass issue due to bad return types Fixes #258 --- grumphp.yml | 2 +- src/Phpro/SoapClient/CodeGenerator/ClientGenerator.php | 2 +- src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grumphp.yml b/grumphp.yml index 98aa0be7..0c1d9d6d 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -14,7 +14,7 @@ parameters: phpunit: ~ phplint: ~ phpstan: - level: 4 + level: 3 configuration: "phpstan.neon" ignore_patterns: - "spec/" diff --git a/src/Phpro/SoapClient/CodeGenerator/ClientGenerator.php b/src/Phpro/SoapClient/CodeGenerator/ClientGenerator.php index 28dcc95c..c451c674 100644 --- a/src/Phpro/SoapClient/CodeGenerator/ClientGenerator.php +++ b/src/Phpro/SoapClient/CodeGenerator/ClientGenerator.php @@ -41,7 +41,7 @@ public function __construct(RuleSetInterface $ruleSet) */ public function generate(FileGenerator $file, $client): string { - $class = $file->getClass() ?? new ClassGenerator(); + $class = $file->getClass() ?: new ClassGenerator(); $class->setNamespaceName($client->getNamespace()); $class->setName($client->getName()); $methods = $client->getMethodMap(); diff --git a/src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php b/src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php index c763cbb1..52b01630 100644 --- a/src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php +++ b/src/Phpro/SoapClient/CodeGenerator/TypeGenerator.php @@ -39,7 +39,7 @@ public function __construct(RuleSetInterface $ruleSet) */ public function generate(FileGenerator $file, $type): string { - $class = $file->getClass() ?? new ClassGenerator(); + $class = $file->getClass() ?: new ClassGenerator(); $class->setNamespaceName($type->getNamespace()); $class->setName($type->getName());