uptimeproject / slack
This package is abandoned and no longer maintained.
No replacement package was suggested.
Simple client to send notifications through Slack webhooks.
0.1.0
2020-06-01 19:46 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpstan/phpstan: ^0.12.25
- phpunit/phpunit: ^7.5
- uptimeproject/php-cs-fixer-config: ^1.1
This package is auto-updated.
Last update: 2022-03-07 20:57:35 UTC
README
A minimal but flexible integration for slack webhooks.
How to use
<?php use UptimeProject\Slack\Workspace; $workspace = new Workspace('https://hooks.slack.com/services/blablabla'); $workspace->from('John')->send('Hello!');
Adding profile icons
If no icon is given, the default icon for the integration is used.
<?php use UptimeProject\Slack\Workspace; $workspace = new Workspace('https://hooks.slack.com/services/blablabla'); // You can use an icon as avatar $workspace->from('John', ':tophat:')->send('Hello!'); // Or an image from the web $imgUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'; $workspace->from('John', $imgUrl)->send('Hello!');
Specifying a channel
If no channel name is given, the default channel for the webhook is used.
<?php use UptimeProject\Slack\Workspace; $workspace = new Workspace('https://hooks.slack.com/services/blablabla'); // Send message to a specific channel $workspace->from('John')->send('Hello!', '#general');
How to contribute
Feel free to create a PR if you have any ideas for improvements. Or create an issue.
- When adding code, make sure to add tests for it (phpunit).
- Make sure the code adheres to our coding standards (use php-cs-fixer to check/fix).
- Also make sure PHPStan does not find any bugs.
vendor/bin/php-cs-fixer fix vendor/bin/phpstan analyze vendor/bin/phpunit --coverage-text
These tools will also run in Github Actions on PR's and pushes on master.