Completed
Push — master ( eb0e60...e48222 )
by Dmitry
02:26
created

Bootstrap::bootstrap()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace hiqdev\assetpackagist;
4
5
use hiqdev\assetpackagist\repositories\PackageRepository;
6
use Yii;
7
use yii\base\Application;
8
use yii\base\BootstrapInterface;
9
10
class Bootstrap implements BootstrapInterface
11
{
12
    /**
13
     * Bootstrap method to be called during application bootstrap stage.
14
     * @param Application $app the application currently running
15
     */
16
    public function bootstrap($app)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
17
    {
18
        Yii::$container->set('db', function () { return Yii::$app->get('db'); });
19
        Yii::$container->set(PackageRepository::class, PackageRepository::class, [\yii\di\Instance::of('db')]);
20
    }
21
}
22