1 | <?php declare(strict_types=1); |
||
18 | class Factory |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * @var \Psr\Log\LoggerInterface |
||
23 | */ |
||
24 | protected $logger; |
||
25 | |||
26 | /** |
||
27 | * @var \FeedIo\Adapter\ClientInterface |
||
28 | */ |
||
29 | protected $client; |
||
30 | |||
31 | /** |
||
32 | * @var \FeedIo\Factory\ClientBuilderInterface |
||
33 | */ |
||
34 | protected $clientBuilder; |
||
35 | |||
36 | /** |
||
37 | * @var \FeedIo\Factory\LoggerBuilderInterface |
||
38 | */ |
||
39 | protected $loggerBuilder; |
||
40 | |||
41 | /** |
||
42 | * @param array $loggerConfig |
||
43 | * @param array $clientConfig |
||
44 | * @return Factory |
||
45 | */ |
||
46 | 3 | public static function create( |
|
68 | |||
69 | /** |
||
70 | * @param ClientBuilderInterface $clientBuilder |
||
71 | * @return Factory |
||
72 | */ |
||
73 | 4 | public function setClientBuilder(ClientBuilderInterface $clientBuilder) : Factory |
|
79 | |||
80 | /** |
||
81 | * @param string $builder |
||
82 | * @param array $args |
||
83 | * @return BuilderInterface |
||
84 | */ |
||
85 | 5 | public function getBuilder(string $builder, array $args = []) : BuilderInterface |
|
98 | |||
99 | /** |
||
100 | * @param $builderConfig |
||
101 | * |
||
102 | * @return array |
||
103 | */ |
||
104 | 5 | public function extractConfig(array $builderConfig) : array |
|
108 | |||
109 | /** |
||
110 | * @return \FeedIo\FeedIo |
||
111 | */ |
||
112 | 3 | public function getFeedIo() : FeedIo |
|
119 | |||
120 | /** |
||
121 | * @param LoggerBuilderInterface $loggerBuilder |
||
122 | * |
||
123 | * @return Factory |
||
124 | */ |
||
125 | 4 | public function setLoggerBuilder(LoggerBuilderInterface $loggerBuilder) : Factory |
|
131 | |||
132 | /** |
||
133 | * @param BuilderInterface $builder |
||
134 | * |
||
135 | * @return boolean true if the dependency is met |
||
136 | */ |
||
137 | 2 | public function checkDependency(BuilderInterface $builder) : bool |
|
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.