Crummy\Phlack\Bridge\Guzzle\PhlackClient::__construct PHP Method

__construct() public method

public __construct ( string $baseUrl = LegacyUrlPlugin::BASE_URL, array | null $config = null )
$baseUrl string
$config array | null
    public function __construct($baseUrl = LegacyUrlPlugin::BASE_URL, $config = null)
    {
        $legacyMode = $this->isLegacyUrl($baseUrl);
        $config = Collection::fromConfig($config ?: [], $this->defaultConfig, $legacyMode ? $this->legacyRequirements : []);
        if ($legacyMode) {
            $this->addSubscriber(new LegacyUrlPlugin($config['username'], $config['token']));
            unset($config['username'], $config['token']);
        }
        parent::__construct($baseUrl, $config);
        $this->setDescription(ServiceDescription::factory(__DIR__ . '/Resources/slack.json'));
    }