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