Completed
Branch 1.x (e134f2)
by Akihito
03:17 queued 02:08
created

Fake   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of the Ray.DbalModule package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
require dirname(dirname(__DIR__)) . '/vendor/autoload.php';
8
9
use Ray\DbalModule\DbalInject;
10
use Ray\DbalModule\DbalModule;
11
use Ray\Di\Injector;
12
13
class Fake
14
{
15
    use DbalInject;
16
17
    public function foo()
18
    {
19
        return $this->db;
20
    }
21
}
22
23
$fake = (new Injector(new DbalModule('driver=pdo_sqlite&memory=true')))->getInstance(Fake::class);
24
$works = ($fake->foo() instanceof \Doctrine\DBAL\Driver\Connection);
25
26
echo($works ? 'It works!' : 'It DOES NOT work!') . PHP_EOL;
27