-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interfaces for client and message (#63)
- Loading branch information
Showing
4 changed files
with
118 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Nexylan packages. | ||
* | ||
* (c) Nexylan SAS <contact@nexylan.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nexy\Slack; | ||
|
||
interface ClientInterface | ||
{ | ||
public function createMessage(): MessageInterface; | ||
|
||
public function sendMessage(MessageInterface $message): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Nexylan packages. | ||
* | ||
* (c) Nexylan SAS <contact@nexylan.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nexy\Slack; | ||
|
||
interface MessageInterface | ||
{ | ||
public function getText(): ?string; | ||
|
||
public function setText(?string $text): self; | ||
|
||
public function getChannel(): ?string; | ||
|
||
public function setChannel(?string $channel): self; | ||
|
||
public function getUsername(): ?string; | ||
|
||
public function setUsername(?string $username): self; | ||
|
||
public function getIcon(): ?string; | ||
|
||
public function setIcon(?string $icon): self; | ||
|
||
public function getIconType(): ?string; | ||
|
||
public function getAllowMarkdown(): bool; | ||
|
||
public function setAllowMarkdown(bool $value): self; | ||
|
||
public function enableMarkdown(): self; | ||
|
||
public function disableMarkdown(): self; | ||
|
||
public function getMarkdownInAttachments(): array; | ||
|
||
public function setMarkdownInAttachments(array $fields): self; | ||
|
||
public function from(string $username): self; | ||
|
||
public function to(string $channel): self; | ||
|
||
public function withIcon(string $icon): self; | ||
|
||
public function attach(Attachment $attachment): self; | ||
|
||
/** @return Attachment[] */ | ||
public function getAttachments(): array; | ||
|
||
/** | ||
* @param Attachment[] $attachments | ||
*/ | ||
public function setAttachments(array $attachments): self; | ||
|
||
public function clearAttachments(): self; | ||
|
||
public function send(?string $text = null): self; | ||
} |