1 | <?php |
||
10 | class Manager |
||
11 | { |
||
12 | /** @var \Wandu\Database\Contracts\Entity\MetadataReaderInterface */ |
||
13 | protected $reader; |
||
14 | |||
15 | /** @var \Wandu\Database\Contracts\ConnectionInterface[] */ |
||
16 | protected $connections = []; |
||
17 | |||
18 | /** @var \Wandu\Database\Repository\Repository[] */ |
||
19 | protected $repositories = []; |
||
20 | |||
21 | 18 | public function __construct(MetadataReaderInterface $reader) |
|
25 | |||
26 | /** |
||
27 | * @param array|\Wandu\Database\Configuration|\Wandu\Database\Contracts\ConnectionInterface $connection |
||
28 | * @param string $name |
||
29 | * @return \Wandu\Database\Contracts\ConnectionInterface |
||
30 | */ |
||
31 | 18 | public function connect($connection, $name = 'default') |
|
48 | |||
49 | /** |
||
50 | * @param string $name |
||
51 | * @return \Wandu\Database\Contracts\ConnectionInterface |
||
52 | */ |
||
53 | 14 | public function connection($name = 'default') |
|
57 | |||
58 | /** |
||
59 | * @param string $class |
||
60 | * @param string $connection |
||
61 | * @return \Wandu\Database\Repository\Repository |
||
62 | */ |
||
63 | 14 | public function repository(string $class, string $connection = 'default'): Repository |
|
71 | } |
||
72 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.