From cb8410c695fc582cdbefedd7fa1bec639e4c828f Mon Sep 17 00:00:00 2001 From: CodeDredd Date: Mon, 4 May 2020 08:10:06 +0200 Subject: [PATCH 1/2] fix(v1): if methods from wsdl are too long, the code generation generates broken comments because of line length set to 80 --- src/Code/Client.php | 4 ++-- src/Code/ClientContract.php | 2 +- src/Code/Validation.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Code/Client.php b/src/Code/Client.php index ed614fc..6c4d7c3 100644 --- a/src/Code/Client.php +++ b/src/Code/Client.php @@ -57,7 +57,7 @@ public function createNewClient() $docBlock = DocBlockGenerator::fromArray([ 'shortDescription' => $this->clientClassName.' Client', 'tags' => $methodTags, - ]); + ])->setWordWrap(false); $constructorDocBlock = DocBlockGenerator::fromArray([ 'shortDescription' => $className.' constructor', ]); @@ -68,7 +68,7 @@ public function createNewClient() new ParamTag('parameters', 'mixed'), new ReturnTag('\CodeDredd\Soap\Client\Response|mixed'), ], - ]); + ])->setWordWrap(false); $callMethodParameters = [ 'method', 'parameters', diff --git a/src/Code/ClientContract.php b/src/Code/ClientContract.php index 7235e17..71d54e9 100644 --- a/src/Code/ClientContract.php +++ b/src/Code/ClientContract.php @@ -43,7 +43,7 @@ public function createNewClientContract() $docBlock = DocBlockGenerator::fromArray([ 'shortDescription' => $this->clientClassName.' Contract', 'tags' => $methodTags, - ]); + ])->setWordWrap(false); return $this->codeClass->setName($className) ->setDocBlock($docBlock); diff --git a/src/Code/Validation.php b/src/Code/Validation.php index 6322c6a..b62fd74 100644 --- a/src/Code/Validation.php +++ b/src/Code/Validation.php @@ -70,7 +70,7 @@ public function createNewValidation(Operation $action) $docBlock = DocBlockGenerator::fromArray([ 'shortDescription' => $this->actionName.' Validation', 'longDescription' => $action->getDescription(), - ]); + ])->setWordWrap(false); $this->codeClass->setName($className) ->setNamespaceName($this->codeNamespace.'\\Validations\\'.$this->clientClassName) ->setDocBlock($docBlock) From 87c909d1df49924b4de7f153b25b6cb4da01c66f Mon Sep 17 00:00:00 2001 From: CodeDredd Date: Mon, 4 May 2020 08:48:11 +0200 Subject: [PATCH 2/2] fix(v1): wrong validation namespace in code generation --- src/Code/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Code/Client.php b/src/Code/Client.php index 6c4d7c3..02c4a0f 100644 --- a/src/Code/Client.php +++ b/src/Code/Client.php @@ -76,7 +76,7 @@ public function createNewClient() $callMethodBody = 'if (static::hasMacro($method)) {'."\n " .'return $this->macroCall($method, $parameters);'."\n" .'}'."\n\n" - .'$validationClass = \'CodeDredd\\\\Soap\\\\Soap\\\\Validations\\\\LaravelSoap\\\\\''."\n " + .'$validationClass = \''.addslashes($this->codeNamespace.'\Validations\LaravelSoap\\')."'\n " .'. ucfirst(Str::camel($method))'."\n " .'. \'Validation\';'."\n" .'if (class_exists($validationClass)) {'."\n "