-
-
Notifications
You must be signed in to change notification settings - Fork 175
/
ManipulatedMetadata.php
39 lines (31 loc) · 1.24 KB
/
ManipulatedMetadata.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace Phpro\SoapClient\Soap\Metadata;
use Phpro\SoapClient\Soap\Metadata\Manipulators\MethodsManipulatorInterface;
use Phpro\SoapClient\Soap\Metadata\Manipulators\TypesManipulatorInterface;
use Soap\Engine\Metadata\Collection\MethodCollection;
use Soap\Engine\Metadata\Collection\TypeCollection;
use Soap\Engine\Metadata\Metadata;
class ManipulatedMetadata implements Metadata
{
private Metadata $metadata;
private TypesManipulatorInterface $typesChangingStrategy;
private MethodsManipulatorInterface $methodsChangingStrategyInterface;
public function __construct(
Metadata $metadata,
MethodsManipulatorInterface $methodsChangingStrategyInterface,
TypesManipulatorInterface $typesChangingStrategy
) {
$this->metadata = $metadata;
$this->methodsChangingStrategyInterface = $methodsChangingStrategyInterface;
$this->typesChangingStrategy = $typesChangingStrategy;
}
public function getTypes(): TypeCollection
{
return ($this->typesChangingStrategy)($this->metadata->getTypes());
}
public function getMethods(): MethodCollection
{
return ($this->methodsChangingStrategyInterface)($this->metadata->getMethods());
}
}