Conditions | 4 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
25 | 24 | public function __construct($baseUrl = LegacyUrlPlugin::BASE_URL, $config = null) |
|
26 | { |
||
27 | 24 | $legacyMode = $this->isLegacyUrl($baseUrl); |
|
28 | |||
29 | 24 | $config = Collection::fromConfig( |
|
30 | 24 | $config ?: [], |
|
31 | 24 | $this->defaultConfig, |
|
32 | 24 | $legacyMode ? $this->legacyRequirements : [] |
|
33 | 24 | ); |
|
34 | |||
35 | 20 | if ($legacyMode) { |
|
36 | 2 | $this->addSubscriber(new LegacyUrlPlugin($config['username'], $config['token'])); |
|
37 | 2 | unset($config['username'], $config['token']); |
|
38 | 2 | } |
|
39 | |||
40 | 20 | parent::__construct($baseUrl, $config); |
|
41 | |||
42 | 20 | $this->setDescription(ServiceDescription::factory(__DIR__.'/Resources/slack.json')); |
|
43 | 20 | } |
|
44 | |||
67 |