Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove security workflow #109

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
386d0e1
Adds queue support
Jul 28, 2015
cde4e11
Install laravel while in development
Jul 28, 2015
28a1f25
Adds tests
Jul 28, 2015
28ce136
Shifts to using Capsule
Jul 28, 2015
c8436fa
Switch to installing Queue instead of support
Jul 28, 2015
e18d526
Fixes tests and mocks guzzle as well
Oct 14, 2015
8d9ce2c
Adds queue documentation in README
Oct 14, 2015
65c77c3
Fixes syntax error in Service Provider
Oct 14, 2015
04f04c4
Fixes Slack Service Provider
Oct 14, 2015
733cfda
Relies on the Laravel queue to instantiate another Queue
Oct 15, 2015
fc14377
add retry mechanism for handling syncronous and async posts
Jun 20, 2016
532bb57
- adding a unified messaging wrapper to send messages either directly…
Jun 20, 2016
f115988
coding convention fixes
Jun 20, 2016
a6c5dc2
code refactoring to remove unnecessary params
Jun 20, 2016
86bdaef
- code cleanup for fixing coding conventions
Jun 22, 2016
cca9d28
Minor refactor
Jun 22, 2016
90ae86c
coding convention fixes
Jun 22, 2016
5f18dce
- move num_retries inside metadata attrib for payload
Jun 24, 2016
fabc604
make slack completely a service. clients can now independently call this
Jun 27, 2016
9ba2db2
coding guideline fix
Jun 27, 2016
2c33353
- fixes job delete after completion
Jun 28, 2016
070857d
minor improvements
Jul 5, 2016
0a94fbb
[refactor]
Jul 8, 2016
d93b965
- set the payload from the message class
Jul 18, 2016
0b0514c
intdentation fixes and remove unnecessary code
Jul 28, 2016
2b97e15
indentation fixes
Jul 28, 2016
df4191a
- increase release wait timeout from 10 to 120 seconds for job release
Aug 1, 2016
aa90671
- adding mock variables to fail slack on queue. To be removed later
Aug 3, 2016
b328389
[slack client refactor]
Aug 3, 2016
2f2f6ab
[Slack] cleanup of code and changed queue implementation
Feb 9, 2017
1a217b4
[SLACK] fix setQueue and getQueue
Feb 9, 2017
df678af
[SLACK] typehint queue
Feb 13, 2017
1054751
Merge pull request #3 from razorpay/f/set-queue-runtime-with-retry
Feb 13, 2017
17fb931
[SLACK] changes in message coding standards
Feb 24, 2017
49cd2e1
[SLACK] changes in attachment coding standards
Feb 24, 2017
d773e34
[SLACK] client and attachmentfield changes
Feb 24, 2017
fb80ebd
[SLACK] test case fix
Feb 25, 2017
2abe95b
[SLACK] update composer file
Feb 28, 2017
7512490
[SLACK] add supprot for php ver 5.4
Feb 28, 2017
05e97a4
[SLACK] minor changes
Feb 28, 2017
38646d0
Merge pull request #4 from razorpay/e/coding-standards
Feb 28, 2017
ca7602f
[SLACK] added support for queue connection
Mar 2, 2017
25ed4de
Brings in line with Razorpay coding guidelines.
shashankkumar Mar 3, 2017
fd8c25d
[SLACK] minor improvements
Mar 3, 2017
b94abc2
Renames _ based functions which are not PHP magic ones.
shashankkumar Mar 3, 2017
1813c44
Merge pull request #7 from razorpay/f/queue-with-conn
Mar 3, 2017
50e77d1
Merge branch 'f/queue-with-retry' into master_update
Mar 6, 2017
b1cd0d8
Merge branch 'f/queue-with-retry' into master_update
Mar 6, 2017
413e1fc
removed dependency from Illuminate
Mar 6, 2017
17b39a2
[SLACK] coding standard changes
Mar 6, 2017
5f5a53c
minor fixes
Mar 6, 2017
471391c
dont catch runtime exception for retry
Mar 6, 2017
06c25d4
[SLACK] fixed numretries
Mar 6, 2017
696d01c
chnaged namespace to Razorpay
Mar 6, 2017
741930a
[Readme] updated reademe for queue
Mar 6, 2017
e0ada2e
[slack] added test cases in MessageUnitTest.php
Mar 9, 2017
a12aeb9
[slack] added test cases for sending msg on queue
Mar 9, 2017
c1fdeb3
[SLACK] increase test coverage to 100% for message.php
Mar 9, 2017
8b4de4e
[slack] test retry
Mar 9, 2017
578e063
[slack] added test cases for client
Mar 9, 2017
3bf2c6d
[slack] added attachment invalid test cases
Mar 9, 2017
9ebfd7a
[slack] achieve enternal test case coverage A.K.A 100%
Mar 9, 2017
7b1100b
Merge pull request #10 from razorpay/master_update
Mar 10, 2017
bc15415
enabled coverall
Mar 11, 2017
a0118a1
updated plugins in README
Mar 11, 2017
cf95897
Merge pull request #11 from razorpay/plugins
Mar 11, 2017
5431923
removed unused code fom phpunit xml conf
Mar 11, 2017
78f2f7a
Merge pull request #12 from razorpay/plugins_fix
Mar 11, 2017
4cbe3dc
updated README
Mar 11, 2017
c14e2ed
removed maintaince note
Mar 13, 2017
f6136ba
Don't use __CLASS__ to push job into the queue
tonylegrone Apr 24, 2017
7978697
Merge pull request #14 from Chronicle-Studio/bug/classname-inheritance
Apr 25, 2017
8195a85
Editorconfig, build ignore, and trusty for travis
harman28 Aug 1, 2017
edab265
Merge pull request #22 from razorpay/trusty
Aug 1, 2017
3ef5d80
Fixes missing url/emoji icons in payload (#23)
adamdburton Sep 22, 2017
5dd89c1
Update AttachmentAction.php
adamdburton May 15, 2018
bb76bf1
[ci] Run builds on php7.1 and 7.2
captn3m0 Oct 15, 2018
47ba59e
Upgrade to GitHub-native Dependabot
dependabot-preview[bot] Apr 28, 2021
759b328
Merge pull request #36 from razorpay/dependabot/add-v2-config-file
ccrims0n Jul 2, 2021
248a4f3
Semgrep Integration
swati31196 Jan 11, 2022
007e56f
Merge pull request #38 from razorpay/semgrep_integration_1641900519
thotakartheek004 Jan 11, 2022
efaea63
Semgrep Integration
swati31196 Jan 21, 2022
d8eec47
Merge pull request #39 from razorpay/semgrep_integration_1642755547
thotakartheek004 Jan 21, 2022
8f1bfcc
composer updates
jayesh-razorpay Aug 29, 2022
526c124
Merge pull request #41 from razorpay/php-upgrade
jayesh-razorpay Sep 5, 2022
79ed7bd
test cases fixed
jayesh-razorpay Nov 4, 2022
a25ec22
print added
jayesh-razorpay Nov 7, 2022
f12eb7c
verify is set to false
jayesh-razorpay Nov 7, 2022
cca8a9e
if condition added for empty endpoint
jayesh-razorpay Nov 8, 2022
fcc8055
updated
jayesh-razorpay Nov 8, 2022
2987568
Merge pull request #43 from razorpay/php-upgrade
jayesh-razorpay Nov 23, 2022
995ba86
Upgrade
rajat-agarwal1 Dec 20, 2023
86e9b55
Merge pull request #75 from razorpay/laravel_upgrade
rajeevrai Apr 5, 2024
bda36d2
removed security workflow
swati31196 May 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
time: "04:00"
timezone: Asia/Calcutta
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
composer.phar
composer.lock
.DS_Store
build/
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
language: php

dist: trusty

php:
- 5.5
- 5.6
- 7.0
- 7.1.0a1
- hhvm

matrix:
allow_failures:
- php: 7.1.0a1
- 7.1
- 7.2

before_script:
- composer install --prefer-source --no-interaction

script:
- phpunit
- mkdir -p build/logs
- vendor/bin/phpunit

after_success:
- travis_retry php vendor/bin/coveralls --coverage_clover=build/logs/clover.xml
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 2014, Regan McEntyre (maknz)
All rights reserved.
Original work Copyright (c) 2014-2016, Regan McEntyre (maknz)
Modified work Copyright (c) 2016-2017, Razorpay

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Expand Down
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Slack for PHP

[![Build Status](https://travis-ci.org/maknz/slack.svg?branch=master)](https://travis-ci.org/maknz/slack)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/maknz/slack/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/maknz/slack/?branch=master)
[![StyleCI](https://styleci.io/repos/19448330/shield)](https://styleci.io/repos/19448330)
[![Build Status](https://travis-ci.org/razorpay/slack.svg?branch=master)](https://travis-ci.org/razorpay/slack)
[![Coverage Status](https://coveralls.io/repos/github/razorpay/slack/badge.svg?branch=master)](https://coveralls.io/github/razorpay/slack?branch=master)

A simple PHP package for sending messages to [Slack](https://slack.com) with [incoming webhooks](https://my.slack.com/services/new/incoming-webhook), focussed on ease-of-use and elegant syntax. **Note: this package is no longer being actively maintained.**
A simple PHP package for sending messages to [Slack](https://slack.com) with [incoming webhooks](https://my.slack.com/services/new/incoming-webhook), focussed on ease-of-use and elegant syntax.

* Laravel integration: [Slack for Laravel](https://github.com/maknz/slack-laravel)
* Laravel integration: [Slack for Laravel](https://github.com/razorpay/slack-laravel)
* Symfony integration: [NexySlackBundle](https://github.com/nexylan/NexySlackBundle)

## Requirements
Expand All @@ -18,7 +17,7 @@ A simple PHP package for sending messages to [Slack](https://slack.com) with [in
You can install the package using the [Composer](https://getcomposer.org/) package manager. You can install it by running this command in your project root:

```sh
composer require maknz/slack
composer require razorpay/slack
```

Then [create an incoming webhook](https://my.slack.com/services/new/incoming-webhook) on your Slack account for the package to use. You'll need the webhook URL to instantiate the client (or for the configuration file if using Laravel).
Expand All @@ -29,7 +28,7 @@ Then [create an incoming webhook](https://my.slack.com/services/new/incoming-web

```php
// Instantiate without defaults
$client = new Maknz\Slack\Client('https://hooks.slack.com/...');
$client = new Razorpay\Slack\Client('https://hooks.slack.com/...');

// Instantiate with defaults, so all messages created
// will be sent from 'Cyril' and to the #accounting channel
Expand All @@ -40,7 +39,7 @@ $settings = [
'link_names' => true
];

$client = new Maknz\Slack\Client('https://hooks.slack.com/...', $settings);
$client = new Razorpay\Slack\Client('https://hooks.slack.com/...', $settings);
```

#### Settings
Expand Down Expand Up @@ -90,6 +89,12 @@ $client->to('@regan')->withIcon(':ghost:')->send('Boo!');
$client->to('#accounting')->withIcon('http://example.com/accounting.png')->send('Some accounting notification');
```

#### Sending a message using Queue
```php

$client->to('#accounting')->withIcon('http://example.com/accounting.png')->queue('Some accounting notification');
```

#### Send an attachment ([preview](https://goo.gl/fp3iaY))

```php
Expand Down Expand Up @@ -176,6 +181,18 @@ $message->to('@regan')->setText('I am sending this explicitly');
$message->send();
```

### Sending via a queue

```php

// $queue is an instance of Illuminate\Queue\QueueManager
$client = new Razorpay\Slack\Client('http://your.slack.endpoint', $settings, $queue);
$client->to('@regan')->queue('I am sending this implicitly');
```

If you are using the Laravel service provider, your default queue will be
automatically used.

### Attachments

When using attachments, the easiest way is to provide an array of data as shown in the examples, which is actually converted to an Attachment object under the hood. You can also attach an Attachment object to the message:
Expand Down
31 changes: 21 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
{
"name": "maknz/slack",
"name": "razorpay/slack",
"description": "A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.",
"keywords": ["laravel", "slack"],
"license": "BSD-2-Clause",
"authors": [
{
"name": "maknz",
"email": "[email protected]"
},
{
"name": "maknz",
"email": "[email protected]"
"name": "Team Razorpay",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.5.0",
"guzzlehttp/guzzle": "~6.0|~5.0|~4.0",
"php": ">=8.1",
"guzzlehttp/guzzle": "~7.0|~6.0|~5.0|~4.0",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "4.2.*",
"mockery/mockery": "0.9.*"
"phpunit/phpunit": "^9.0",
"mockery/mockery": "~0.9",
"illuminate/queue":"^10.0",
"php-coveralls/php-coveralls": "~2.5"
},
"suggest": {
"maknz/slack-laravel": "Required for Laravel support",
"razorpay/slack-laravel": "Required for Laravel support",
"nexylan/slack-bundle": "Required for Symfony bundle support"
},
"autoload": {
"psr-4": {
"Maknz\\Slack\\": "src/"
"Razorpay\\Slack\\": "src/"
}
},
"minimum-stability": "stable"
"minimum-stability": "stable",
"config": {
"allow-plugins": {
"kylekatarnls/update-helper": false
}
}
}
16 changes: 16 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,26 @@
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
beStrictAboutTestsThatDoNotTestAnything="false"
>
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./src</directory>
<exclude>
<directory>./build</directory>
<directory>./composer</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
22 changes: 13 additions & 9 deletions src/ActionConfirmation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Maknz\Slack;
namespace Razorpay\Slack;

class ActionConfirmation
{
Expand Down Expand Up @@ -40,19 +40,23 @@ class ActionConfirmation
*/
public function __construct(array $attributes)
{
if (isset($attributes['title'])) {
if (isset($attributes['title']))
{
$this->setTitle($attributes['title']);
}

if (isset($attributes['text'])) {
if (isset($attributes['text']))
{
$this->setText($attributes['text']);
}

if (isset($attributes['ok_text'])) {
if (isset($attributes['ok_text']))
{
$this->setOkText($attributes['ok_text']);
}

if (isset($attributes['dismiss_text'])) {
if (isset($attributes['dismiss_text']))
{
$this->setDismissText($attributes['dismiss_text']);
}
}
Expand Down Expand Up @@ -141,10 +145,10 @@ public function setDismissText($dismissText)
public function toArray()
{
return [
'title' => $this->getTitle(),
'text' => $this->getText(),
'ok_text' => $this->getOkText(),
'dismiss_text' => $this->getDismissText(),
'title' => $this->getTitle(),
'text' => $this->getText(),
'ok_text' => $this->getOkText(),
'dismiss_text' => $this->getDismissText(),
];
}
}
Loading