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