These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * DatabaseService.php |
||
4 | */ |
||
5 | |||
6 | namespace HDNET\Importr\Service; |
||
7 | |||
8 | /** |
||
9 | * DatabaseService |
||
10 | */ |
||
11 | class DatabaseService |
||
12 | { |
||
13 | /** |
||
14 | * @return \TYPO3\CMS\Core\Database\DatabaseConnection |
||
15 | */ |
||
16 | public function getDatabaseConnection() |
||
0 ignored issues
–
show
|
|||
17 | { |
||
18 | return $GLOBALS['TYPO3_DB']; |
||
19 | } |
||
20 | } |
||
21 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: