1 | <?php |
||
14 | class ClientFactory |
||
15 | { |
||
16 | protected $namespaces = []; |
||
17 | protected $metadata = []; |
||
18 | /** |
||
19 | * @var SerializerInterface |
||
20 | */ |
||
21 | protected $serializer; |
||
22 | /** |
||
23 | * @var MessageFactory |
||
24 | */ |
||
25 | protected $messageFactory; |
||
26 | |||
27 | /** |
||
28 | * @var HttpClient |
||
29 | */ |
||
30 | protected $httpClient; |
||
31 | |||
32 | /** |
||
33 | * @var PhpMetadataGeneratorInterface |
||
34 | */ |
||
35 | private $generator; |
||
36 | |||
37 | private $unwrap = false; |
||
38 | |||
39 | 14 | public function __construct(array $namespaces, SerializerInterface $serializer) |
|
47 | |||
48 | public function setUnwrapResponses($unwrap) |
||
52 | |||
53 | 10 | public function setHttpClient(HttpClient $client) |
|
54 | { |
||
55 | 10 | $this->httpClient = $client; |
|
56 | 10 | } |
|
57 | |||
58 | /** |
||
59 | * @param MessageFactory $messageFactory |
||
60 | */ |
||
61 | public function setMessageFactory(MessageFactory $messageFactory) |
||
65 | |||
66 | 14 | public function setSerializer(SerializerInterface $serializer) |
|
70 | |||
71 | 14 | public function setMetadataGenerator(PhpMetadataGeneratorInterface $generator) |
|
75 | |||
76 | 14 | private function getSoapService($wsdl, $portName = null, $serviceName = null) |
|
89 | |||
90 | 14 | public function addNamespace($uri, $phpNs) |
|
94 | |||
95 | /** |
||
96 | * @param string $wsdl |
||
97 | * @param null|string $portName |
||
98 | * @param null|string $serviceName |
||
99 | * @param null|bool $unwrap |
||
100 | * @return Client |
||
101 | */ |
||
102 | 14 | public function getClient($wsdl, $portName = null, $serviceName = null, $unwrap = null) |
|
112 | |||
113 | /** |
||
114 | * @param $serviceName |
||
115 | * @param array $services |
||
116 | * @return array |
||
117 | * @throws ServiceNotFoundException |
||
118 | */ |
||
119 | 14 | private function getService($serviceName, array $services) |
|
129 | |||
130 | /** |
||
131 | * @param string $portName |
||
132 | * @param array $service |
||
133 | * @return array |
||
134 | * @throws PortNotFoundException |
||
135 | */ |
||
136 | 14 | private function getPort($portName, array $service) |
|
146 | } |
||
147 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.