Skip to content

Commit

Permalink
Migration from zend-code to laminas-code (phpro#295)
Browse files Browse the repository at this point in the history
* migrated zendframework/zend-code to laminas/laminas-code using laminas/laminas-migration
* refactored code by renaming classes and methods from Zend to Laminas, adding deprecated proxy classes/methods for the old names to be dropped in the next major release
* refactored specs and unit tests to reflect migration to laminas-code
* updated docs to mention laminas-code
  • Loading branch information
driehle committed Apr 24, 2020
1 parent 0f8473b commit baa5ce4
Show file tree
Hide file tree
Showing 72 changed files with 295 additions and 242 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Since life is too short to read documentation,
All you need to do is:

```sh
composer require --dev zendframework/zend-code:^3.1.0
composer require --dev laminas/laminas-code:^3.1.0
./vendor/bin/soap-client wizard
```

Expand Down
152 changes: 78 additions & 74 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,77 +1,81 @@
{
"name": "phpro/soap-client",
"description": "A general purpose SoapClient library",
"keywords": ["soap"],
"license": "MIT",
"authors": [
{
"name": "Toon Verwerft",
"email": "[email protected]"
"name": "phpro/soap-client",
"description": "A general purpose SoapClient library",
"keywords": [
"soap"
],
"license": "MIT",
"authors": [
{
"name": "Toon Verwerft",
"email": "[email protected]"
}
],
"require": {
"php": "^7.2",
"ext-dom": "*",
"ext-xml": "*",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.0",
"symfony/console": "~3.4|~4.0|~5.0",
"symfony/event-dispatcher": "~3.4|~4.0|~5.0",
"symfony/filesystem": "~3.4|~4.0|~5.0",
"symfony/options-resolver": "~3.4|~4.0|~5.0"
},
"require-dev": {
"ext-soap": "*",
"guzzlehttp/guzzle": "^6.4.1",
"guzzlehttp/promises": "^1.3.1",
"guzzlehttp/psr7": "^1.6.1",
"jakub-onderka/php-parallel-lint": "^1.0",
"php-http/client-common": "^1.10",
"php-http/discovery": "^1.7",
"php-http/guzzle6-adapter": "^1.1.1",
"php-http/httplug": "^1.1",
"php-http/message": "^1.8",
"php-http/message-factory": "^1.0",
"php-http/mock-client": "^1.3",
"php-vcr/php-vcr": "~1.4.4",
"phpro/grumphp": "~0.17.1",
"phpspec/phpspec": "~6.1",
"phpstan/phpstan": "^0.11.19",
"phpunit/phpunit": "~8.5",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0.1",
"robrichards/wse-php": "^2.0.3",
"robrichards/xmlseclibs": "^3.0",
"squizlabs/php_codesniffer": "~2.9",
"symfony/validator": "~3.4|~4.0|~5.0",
"laminas/laminas-code": "^3.4.0"
},
"suggest": {
"ext-soap": "If you want to use PHP's ext-soap driver.",
"php-http/client-implementation": "For gaining control over the HTTP layer",
"phpro/annotated-cache": "For caching SOAP responses",
"psr/log-implementation": "For logging SOAP requests, responses and errors",
"psr/http-message": "For gaining control over the HTTP layer",
"php-http/httplug": "For gaining control over the HTTP layer",
"php-http/message-factory": "For gaining control over the HTTP layer",
"php-http/discovery": "For gaining control over the HTTP layer",
"php-http/message": "For gaining control over the HTTP layer",
"php-http/client-common": "For gaining control over the HTTP layer",
"robrichards/wse-php": "If you want to use the WSA or WSSE middleware",
"symfony/validator": "If you easily want to validate SOAP requests / responses manually"
},
"autoload": {
"psr-0": {
"Phpro\\SoapClient\\": "src/"
}
},
"autoload-dev": {
"psr-0": {
"PhproTest\\SoapClient\\": "test/"
}
},
"bin": [
"bin/soap-client"
],
"config": {
"sort-packages": true
}
],
"require": {
"php": "^7.2",
"ext-dom": "*",
"ext-xml": "*",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1.0",
"symfony/console": "~3.4|~4.0|~5.0",
"symfony/event-dispatcher": "~3.4|~4.0|~5.0",
"symfony/filesystem": "~3.4|~4.0|~5.0",
"symfony/options-resolver": "~3.4|~4.0|~5.0"
},
"require-dev": {
"ext-soap": "*",
"guzzlehttp/guzzle": "^6.4.1",
"guzzlehttp/promises": "^1.3.1",
"guzzlehttp/psr7": "^1.6.1",
"jakub-onderka/php-parallel-lint": "^1.0",
"php-http/client-common": "^1.10",
"php-http/discovery": "^1.7",
"php-http/guzzle6-adapter": "^1.1.1",
"php-http/httplug": "^1.1",
"php-http/message": "^1.8",
"php-http/message-factory": "^1.0",
"php-http/mock-client": "^1.3",
"php-vcr/php-vcr": "~1.4.4",
"phpro/grumphp": "~0.17.1",
"phpspec/phpspec": "~6.1",
"phpstan/phpstan": "^0.11.19",
"phpunit/phpunit": "~8.5",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0.1",
"robrichards/wse-php": "^2.0.3",
"robrichards/xmlseclibs": "^3.0",
"squizlabs/php_codesniffer": "~2.9",
"symfony/validator": "~3.4|~4.0|~5.0",
"zendframework/zend-code": "^3.4.0"
},
"suggest": {
"ext-soap": "If you want to use PHP's ext-soap driver.",
"php-http/client-implementation": "For gaining control over the HTTP layer",
"phpro/annotated-cache": "For caching SOAP responses",
"psr/log-implementation": "For logging SOAP requests, responses and errors",
"psr/http-message": "For gaining control over the HTTP layer",
"php-http/httplug": "For gaining control over the HTTP layer",
"php-http/message-factory": "For gaining control over the HTTP layer",
"php-http/discovery": "For gaining control over the HTTP layer",
"php-http/message": "For gaining control over the HTTP layer",
"php-http/client-common": "For gaining control over the HTTP layer",
"robrichards/wse-php": "If you want to use the WSA or WSSE middleware",
"symfony/validator": "If you easily want to validate SOAP requests / responses manually"
},
"autoload": {
"psr-0": {
"Phpro\\SoapClient\\": "src/"
}
},
"autoload-dev": {
"psr-0": {
"PhproTest\\SoapClient\\": "test/"
}
},
"bin": ["bin/soap-client"],
"config": {
"sort-packages": true
}
}
2 changes: 1 addition & 1 deletion docs/cli/generate-classmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before you can generate code, you'll need to add some additional dev dependencies to your project:
```sh
composer require --dev zendframework/zend-code:^3.1.0
composer require --dev laminas/laminas-code:^3.1.0
```

When the value-objects are generated, we need to tell SOAP about how the PHP classes are mapped to the XSD types.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/generate-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before you can generate code, you'll need to add some additional dev dependencies to your project:
```sh
composer require --dev zendframework/zend-code:^3.1.0
composer require --dev laminas/laminas-code:^3.1.0
```

A client with type and return type hints can be generated.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/generate-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Before you can generate code, you'll need to add some additional dev dependencies to your project:
```sh
composer require --dev zendframework/zend-code:^3.1.0
composer require --dev laminas/laminas-code:^3.1.0
```

Basic value-objects can be generated automatically.
Expand Down
4 changes: 2 additions & 2 deletions docs/code-generation/assemblers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code assemblers

Code assemblers are a thin layer above [zend-code](https://github.com/zendframework/zend-code).
Code assemblers are a thin layer above [laminas-code](https://github.com/laminas/laminas-code).
There are a lot of built-in assemblers but it is also possible to create your own assembler
to generate the code you want to add to the generated SOAP types.

Expand Down Expand Up @@ -440,7 +440,7 @@ Example output:

Creating your own Assembler is pretty easy.
The only thing you'll need to do is implementing the `AssemblerInterface`.
You can use the [zend-code](https://github.com/zendframework/zend-code) `ClassGenerator` and `FileGenerator` to manipulate your code.
You can use the [laminas-code](https://github.com/laminas/laminas-code) `ClassGenerator` and `FileGenerator` to manipulate your code.

```php
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Phpro\SoapClient\CodeGenerator\Rules\RuleSetInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class ClassMapGeneratorSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Phpro\SoapClient\CodeGenerator\ClientFactoryGenerator;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class ClientFactoryGeneratorSpec
Expand Down
4 changes: 2 additions & 2 deletions spec/Phpro/SoapClient/CodeGenerator/ClientGeneratorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Phpro\SoapClient\CodeGenerator\Rules\RuleSetInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class ClientGeneratorSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Phpro\SoapClient\CodeGenerator\Model\TypeMap;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class ClassMapContextSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Phpro\SoapClient\CodeGenerator\Context\ClientFactoryContext;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class ClientFactoryContextSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Phpro\SoapClient\CodeGenerator\Context\TypeContext;
use Phpro\SoapClient\CodeGenerator\Model\ClientMethod;
use PhpSpec\ObjectBehavior;
use Zend\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\ClassGenerator;

/**
* Class ClientMethodContextSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Phpro\SoapClient\CodeGenerator\Model\Type;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\ClassGenerator;

/**
* Class PropertyContextSpec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Phpro\SoapClient\CodeGenerator\Model\Type;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\ClassGenerator;

/**
* Class TypeContextSpec
Expand Down
4 changes: 2 additions & 2 deletions spec/Phpro/SoapClient/CodeGenerator/TypeGeneratorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use Phpro\SoapClient\CodeGenerator\TypeGenerator;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\FileGenerator;
use Laminas\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\FileGenerator;

/**
* Class TypeGeneratorSpec
Expand Down
14 changes: 7 additions & 7 deletions spec/Phpro/SoapClient/CodeGenerator/Util/ValidatorSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ function it_is_initializable()
$this->shouldHaveType(Validator::class);
}

function it_can_tell_what_commands_need_zend_code()
function it_can_tell_what_commands_need_laminas_code()
{
$this->commandRequiresZendCode('wizard')->shouldBe(true);
$this->commandRequiresZendCode('generate')->shouldBe(true);
$this->commandRequiresZendCode('generate:something')->shouldBe(true);
$this->commandRequiresZendCode('list')->shouldBe(false);
$this->commandRequiresLaminasCode('wizard')->shouldBe(true);
$this->commandRequiresLaminasCode('generate')->shouldBe(true);
$this->commandRequiresLaminasCode('generate:something')->shouldBe(true);
$this->commandRequiresLaminasCode('list')->shouldBe(false);
}

function it_can_tell_if_zend_code_is_installed()
function it_can_tell_if_laminas_code_is_installed()
{
$this->zendCodeIsInstalled()->shouldBe(true);
$this->laminasCodeIsInstalled()->shouldBe(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

namespace spec\Phpro\SoapClient\Console\Event\Subscriber;

use Phpro\SoapClient\Console\Event\Subscriber\ZendCodeValidationSubscriber;
use Phpro\SoapClient\Console\Event\Subscriber\LaminasCodeValidationSubscriber;
use PhpSpec\ObjectBehavior;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
* Class ZendCodeValidationSubscriberSpec
* Class LaminasCodeValidationSubscriberSpec
* @package spec\Phpro\SoapClient\Event
*/
class ZendCodeValidationSubscriberSpec extends ObjectBehavior
class LaminasCodeValidationSubscriberSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(ZendCodeValidationSubscriber::class);
$this->shouldHaveType(LaminasCodeValidationSubscriber::class);
}

function it_be_an_eventsubsciberinterface()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Phpro\SoapClient\Exception\AssemblerException;
use Phpro\SoapClient\Soap\ClassMap\ClassMap;
use Phpro\SoapClient\Soap\ClassMap\ClassMapCollection;
use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\MethodGenerator;
use Laminas\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\MethodGenerator;

/**
* Class ClassMapAssembler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
use Phpro\SoapClient\CodeGenerator\Context\ClientMethodContext;
use Phpro\SoapClient\CodeGenerator\Context\ContextInterface;
use Phpro\SoapClient\CodeGenerator\Util\Normalizer;
use Phpro\SoapClient\CodeGenerator\ZendCodeFactory\DocBlockGeneratorFactory;
use Phpro\SoapClient\CodeGenerator\LaminasCodeFactory\DocBlockGeneratorFactory;
use Phpro\SoapClient\Exception\AssemblerException;
use Phpro\SoapClient\Exception\SoapException;
use Phpro\SoapClient\Type\MultiArgumentRequest;
use Phpro\SoapClient\Type\RequestInterface;
use Phpro\SoapClient\Type\ResultInterface;
use Zend\Code\Generator\ClassGenerator;
use Zend\Code\Generator\DocBlockGenerator;
use Zend\Code\Generator\MethodGenerator;
use Zend\Code\Generator\ParameterGenerator;
use Laminas\Code\Generator\ClassGenerator;
use Laminas\Code\Generator\DocBlockGenerator;
use Laminas\Code\Generator\MethodGenerator;
use Laminas\Code\Generator\ParameterGenerator;

class ClientMethodAssembler implements AssemblerInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
use Phpro\SoapClient\CodeGenerator\Context\ContextInterface;
use Phpro\SoapClient\CodeGenerator\Context\TypeContext;
use Phpro\SoapClient\CodeGenerator\Model\Type;
use Phpro\SoapClient\CodeGenerator\ZendCodeFactory\DocBlockGeneratorFactory;
use Phpro\SoapClient\CodeGenerator\LaminasCodeFactory\DocBlockGeneratorFactory;
use Phpro\SoapClient\Exception\AssemblerException;
use Zend\Code\Generator\MethodGenerator;
use Laminas\Code\Generator\MethodGenerator;

/**
* Class ConstructorAssembler
Expand Down Expand Up @@ -62,7 +62,7 @@ public function assemble(ContextInterface $context)
* @param Type $type
*
* @return MethodGenerator
* @throws \Zend\Code\Generator\Exception\InvalidArgumentException
* @throws \Laminas\Code\Generator\Exception\InvalidArgumentException
*/
private function assembleConstructor(Type $type): MethodGenerator
{
Expand Down
Loading

0 comments on commit baa5ce4

Please sign in to comment.