Skip to content

Commit

Permalink
Merge pull request #19 from t3ko/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
t3ko authored Feb 6, 2021
2 parents e81eeb6 + 34c79fd commit 7a45560
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,9 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest
run: composer update --prefer-dist --no-progress

- name: Run test suite
run: composer test
15 changes: 8 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@
}
],
"require": {
"phpro/soap-client": "0.6.0",
"phpro/soap-client": "^1.0",
"sabre/xml": "^2.1",
"psr/http-client": "^1.0",
"psr/http-client-implementation": "*",
"php-http/message-factory": "^1.0"
"psr/http-client-implementation": "^1.0",
"php-http/message-factory": "^1.0",
"psr/http-message": "^1.0",
"php-http/httplug": "^2.1",
"php-http/discovery": "^1.7",
"php-http/message": "^1.8",
"php-http/client-common": "^2.1"
},
"require-dev": {
"php-http/message": "^1.6",
"php-http/mock-client": "^1.0",
"guzzlehttp/psr7": "^1.4",
"php-http/guzzle6-adapter": "^2",
"phpspec/phpspec": "~3.2",
"phpspec/prophecy": "~1.6",
"phpunit/phpunit": "~7.0",
"thomasweinert/phpunit-xpath-assertions": "^2.0"
},
Expand Down
28 changes: 13 additions & 15 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace T3ko\Dpd;

use Phpro\SoapClient\ClientBuilder;
use Phpro\SoapClient\ClientFactory;
use Phpro\SoapClient\Soap\ClassMap\ClassMap;
use Phpro\SoapClient\Soap\ClassMap\ClassMapCollection;
use Phpro\SoapClient\Soap\Driver\ExtSoap\ExtSoapEngineFactory;
use Phpro\SoapClient\Soap\Driver\ExtSoap\ExtSoapOptions;
use Phpro\SoapClient\Soap\Handler\HttPlugHandle;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcher;
use T3ko\Dpd\Request\CollectionOrderRequest;
use T3ko\Dpd\Request\FindPostalCodeRequest;
use T3ko\Dpd\Request\GenerateLabelsRequest;
Expand Down Expand Up @@ -234,21 +235,18 @@ private function obtainInfoServiceClient()
*/
private function obtainClient($clientClass)
{
$factory = new ClientFactory($clientClass);
$builder = new ClientBuilder(
$factory,
$this->getWsdl($clientClass),
[
'cache_wsdl' => WSDL_CACHE_NONE,
]
$engine = ExtSoapEngineFactory::fromOptionsWithHandler(
ExtSoapOptions::defaults(
$this->getWsdl($clientClass),
[
'cache_wsdl' => WSDL_CACHE_NONE,
])
->withClassMap($this->getClassMaps()),
HttPlugHandle::createWithDefaultClient()
);
$builder->withHandler(HttPlugHandle::createWithDefaultClient());
$builder->withClassMaps($this->getClassMaps());
if ($this->logger instanceof LoggerInterface) {
$builder->withLogger($this->logger);
}
$eventDispatcher = new EventDispatcher();

return $builder->build();
return new $clientClass($engine, $eventDispatcher);
}

private function getClassMaps()
Expand Down

0 comments on commit 7a45560

Please sign in to comment.