Test Failed
Push — develop ( f585b7...c7796c )
by Oguzhan
02:31
created

BaseCommand::initializeService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 0
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: oguzu
5
 * Date: 27-3-2017
6
 * Time: 16:52
7
 */
8
9
namespace Pbxg33k\MusicInfo\Command;
10
11
12
use Pbxg33k\MusicInfo\MusicInfo;
13
use Symfony\Component\Yaml\Yaml;
14
use Pbxg33k\InfoBase\Command\BaseCommand as InfoBaseCommand;
15
16
abstract class BaseCommand extends InfoBaseCommand
17
{
18
    protected function initializeService()
19
    {
20
        $config = Yaml::parse(file_get_contents(__DIR__ . '/../Resources/config/config.yml'));
21
22
        $this->infoService = new MusicInfo($config['music_info']);
23
    }
24
25
    /**
26
     * @param MusicInfo $musicInfo
27
     * @return BaseCommand
28
     */
29
    public function setMusicInfo($musicInfo)
30
    {
31
        $this->infoService = $musicInfo;
32
        return $this;
33
    }
34
}
35