1 | <?php |
||
14 | class ClientFactory |
||
15 | { |
||
16 | /** |
||
17 | * @var SerializerInterface |
||
18 | */ |
||
19 | protected $serializer; |
||
20 | /** |
||
21 | * @var MessageFactory |
||
22 | */ |
||
23 | protected $messageFactory; |
||
24 | |||
25 | /** |
||
26 | * @var HttpClient |
||
27 | */ |
||
28 | protected $httpClient; |
||
29 | |||
30 | /** |
||
31 | * @var MetadataLoaderInterface |
||
32 | */ |
||
33 | private $reader; |
||
34 | |||
35 | /** |
||
36 | * @var HeaderHandler |
||
37 | */ |
||
38 | private $headerHandler; |
||
39 | |||
40 | 34 | public function __construct(MetadataLoaderInterface $reader, SerializerInterface $serializer) |
|
45 | |||
46 | 30 | public function setHeaderHandler(HeaderHandler $headerHandler) |
|
50 | |||
51 | 30 | public function setHttpClient(HttpClient $client) |
|
55 | |||
56 | /** |
||
57 | * @param MessageFactory $messageFactory |
||
58 | */ |
||
59 | 1 | public function setMessageFactory(MessageFactory $messageFactory) |
|
60 | 1 | { |
|
61 | 1 | $this->messageFactory = $messageFactory; |
|
62 | } |
||
63 | |||
64 | 34 | public function setSerializer(SerializerInterface $serializer) |
|
68 | |||
69 | 34 | public function setMetadataReader(MetadataLoaderInterface $reader) |
|
73 | |||
74 | 34 | private function getSoapService($wsdl, $portName = null, $serviceName = null) |
|
80 | |||
81 | /** |
||
82 | * @param string $wsdl |
||
83 | * @param null|string $portName |
||
84 | * @param null|string $serviceName |
||
85 | * @return Client |
||
86 | */ |
||
87 | 34 | public function getClient($wsdl, $portName = null, $serviceName = null) |
|
97 | |||
98 | /** |
||
99 | * @param $serviceName |
||
100 | * @param array $services |
||
101 | * @return array |
||
102 | * @throws ServiceNotFoundException |
||
103 | */ |
||
104 | 34 | private function getService($serviceName, array $services) |
|
114 | |||
115 | /** |
||
116 | * @param string $portName |
||
117 | * @param array $service |
||
118 | * @return array |
||
119 | * @throws PortNotFoundException |
||
120 | */ |
||
121 | 34 | private function getPort($portName, array $service) |
|
131 | } |
||
132 |
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.