Skip to content

Commit

Permalink
rename attributes to options
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Jan 26, 2018
1 parent a981762 commit d8dede2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/Client.php
Expand Up @@ -87,46 +87,46 @@ class Client
* Instantiate a new Client.
*
* @param string $endpoint
* @param array $attributes
* @param array $options
* @param \GuzzleHttp\Client|null $guzzle
*
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/
public function __construct($endpoint, array $attributes = [], Guzzle $guzzle = null)
public function __construct($endpoint, array $options = [], Guzzle $guzzle = null)
{
$this->endpoint = $endpoint;

if (isset($attributes['channel'])) {
$this->setDefaultChannel($attributes['channel']);
if (isset($options['channel'])) {
$this->setDefaultChannel($options['channel']);
}

if (isset($attributes['username'])) {
$this->setDefaultUsername($attributes['username']);
if (isset($options['username'])) {
$this->setDefaultUsername($options['username']);
}

if (isset($attributes['icon'])) {
$this->setDefaultIcon($attributes['icon']);
if (isset($options['icon'])) {
$this->setDefaultIcon($options['icon']);
}

if (isset($attributes['link_names'])) {
$this->setLinkNames($attributes['link_names']);
if (isset($options['link_names'])) {
$this->setLinkNames($options['link_names']);
}

if (isset($attributes['unfurl_links'])) {
$this->setUnfurlLinks($attributes['unfurl_links']);
if (isset($options['unfurl_links'])) {
$this->setUnfurlLinks($options['unfurl_links']);
}

if (isset($attributes['unfurl_media'])) {
$this->setUnfurlMedia($attributes['unfurl_media']);
if (isset($options['unfurl_media'])) {
$this->setUnfurlMedia($options['unfurl_media']);
}

if (isset($attributes['allow_markdown'])) {
$this->setAllowMarkdown($attributes['allow_markdown']);
if (isset($options['allow_markdown'])) {
$this->setAllowMarkdown($options['allow_markdown']);
}

if (isset($attributes['markdown_in_attachments'])) {
$this->setMarkdownInAttachments($attributes['markdown_in_attachments']);
if (isset($options['markdown_in_attachments'])) {
$this->setMarkdownInAttachments($options['markdown_in_attachments']);
}

$this->guzzle = $guzzle ?: new Guzzle;
Expand Down

0 comments on commit d8dede2

Please sign in to comment.