1 | <?php |
||
8 | trait ConnectorConnectTrait |
||
9 | { |
||
10 | use SupportsEvents; |
||
11 | |||
12 | /** |
||
13 | * Establish a database connection. |
||
14 | * |
||
15 | * @param array $config |
||
16 | * @return \PDO |
||
17 | */ |
||
18 | 39 | public function connect(array $config) |
|
30 | |||
31 | /** |
||
32 | * Call connect on the parent class to establish a database connection. |
||
33 | * |
||
34 | * @param array $config |
||
35 | * @return \PDO |
||
36 | */ |
||
37 | 3 | protected function parentConnect(array $config) |
|
41 | } |
||
42 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.