Skip to content

Commit ec8d4b1

Browse files
authored
Merge pull request #148 from onlime/4.x
Major overhaul for a possible 4.x release, twilio/sdk 8.x
2 parents 761d57b + f90ab62 commit ec8d4b1

31 files changed

+516
-405
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
/.gitignore export-ignore
88
/.travis.yml export-ignore
99
/phpunit.xml.dist export-ignore
10-
/.scrutinizer.yml export-ignore
11-
/.styleci.yml export-ignore
1210
/.editorconfig export-ignore
1311
/tests export-ignore

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
phplint:
7+
runs-on: ubuntu-latest
8+
9+
name: PHP Linting (Pint)
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: "laravel-pint"
16+
uses: aglipanci/laravel-pint-action@latest
17+
with:
18+
preset: laravel
19+
verboseMode: true
20+
testMode: true
21+
configPath: "pint.json"
22+
pintVersion: 1.18.2
23+
onlyDirty: true
24+
25+
test:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
max-parallel: 15
29+
fail-fast: false
30+
matrix:
31+
php: [8.3, 8.2]
32+
laravel: [11.*]
33+
stability: [prefer-lowest, prefer-stable]
34+
include:
35+
- laravel: 11.*
36+
testbench: 9.*
37+
38+
name: PHP${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
44+
- name: Setup PHP
45+
uses: shivammathur/setup-php@v2
46+
with:
47+
php-version: ${{ matrix.php }}
48+
extensions: mbstring, xdebug
49+
coverage: xdebug
50+
51+
- name: Install dependencies
52+
run: |
53+
composer require "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
54+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest
55+
56+
- name: Lint composer.json
57+
run: composer validate
58+
59+
- name: Run Tests
60+
run: composer test:unit
61+
62+
- name: Run Integration Tests
63+
run: composer test:integration

.github/workflows/php.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ phpunit.phar
2727

2828
# build
2929
build
30+
31+
# laravel/pint
32+
.pint.cache.json

.scrutinizer.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.styleci.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Changelog
22

3-
All notable changes to `twilio` will be documented in this file
3+
All notable changes to `laravel-notification-channels/twilio` will be documented in this file.
4+
5+
## 4.0.0
6+
7+
- Added PHP Linting (Pint) to CI workflow
8+
- Additional tests to achieve 100% code coverage by @pascalbaljet
9+
- Update PhpUnit to 10.5 and fixed all tests.
10+
- Bump `twilio/sdk` to 8.3
11+
- Improved types and use constructor property promotion everywhere.
12+
- Added Pint and fixed PHP syntax.
13+
- Drop support for PHP < 8.2 **BREAKING CHANGE**
14+
- Drop support for Laravel 7.x, 8.x, 9.x, and 10.x **BREAKING CHANGE**
15+
- Enable overriding the Twilio message source #142
16+
- Add enabled config option (`TWILIO_ENABLED`) to disable the channel #21
417

518
## 3.0.0
619

README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
# Twilio notifications channel for Laravel
22

3-
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/twilio.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/twilio)
4-
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5-
[![Build Status](https://img.shields.io/github/workflow/status/laravel-notification-channels/twilio/PHP?style=flat-square)](https://travis-ci.org/laravel-notification-channels/twilio)
6-
[![StyleCI](https://styleci.io/repos/65543339/shield)](https://styleci.io/repos/65543339)
7-
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-notification-channels/twilio.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio)
8-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/twilio/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio/?branch=master)
9-
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/twilio.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/twilio)
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/twilio.svg)](https://packagist.org/packages/laravel-notification-channels/twilio)
4+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
5+
[![Build Status](https://github.com/laravel-notification-channels/twilio/actions/workflows/ci.yml/badge.svg)](https://github.com/laravel-notification-channels/twilio/actions/workflows/ci.yml)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/twilio.svg)](https://packagist.org/packages/laravel-notification-channels/twilio)
107

11-
This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 5.5+, 6.x, 7.x, 8.x & 9.x
12-
13-
You are viewing the `3.x` documentation. [Click here](https://github.com/laravel-notification-channels/twilio/tree/2.x) to view the `2.x` documentation.
8+
This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 11.x
149

1510
## Contents
1611

@@ -26,10 +21,10 @@ You are viewing the `3.x` documentation. [Click here](https://github.com/laravel
2621

2722
## Installation
2823

29-
You can install the package via composer:
24+
You can install the package via Composer:
3025

3126
``` bash
32-
composer require laravel-notification-channels/twilio
27+
$ composer require laravel-notification-channels/twilio
3328
```
3429

3530
### Configuration
@@ -58,7 +53,7 @@ Run `php artisan vendor:publish --provider="NotificationChannels\Twilio\TwilioPr
5853
#### Suppressing specific errors or all errors
5954

6055
Publish the config using the above command, and edit the `ignored_error_codes` array. You can get the list of
61-
exception codes from [the documentation](https://www.twilio.com/docs/api/errors).
56+
exception codes from [the documentation](https://www.twilio.com/docs/api/errors).
6257

6358
If you want to suppress all errors, you can set the option to `['*']`. The errors will not be logged but notification
6459
failed events will still be emitted.
@@ -70,15 +65,19 @@ Twilio recommends always using a [Messaging Service](https://www.twilio.com/docs
7065

7166
Having issues with SMS? Check Twilio's [best practices](https://www.twilio.com/docs/sms/services/services-best-practices).
7267

68+
## Upgrading from 3.x to 4.x
69+
70+
We have dropped support for PHP < 8.2 and the minimum Laravel version is now 11. Other than that, there are no breaking changes.
71+
7372
## Upgrading from 2.x to 3.x
7473

75-
If you're upgrading from version `2.x`, you'll need to make sure that your set environment variables match those above
76-
in the config section. None of the environment variable names have changed, but if you used different keys in your
74+
If you're upgrading from version `2.x`, you'll need to make sure that your set environment variables match those above
75+
in the config section. None of the environment variable names have changed, but if you used different keys in your
7776
`services.php` config then you'll need to update them to match the above, or publish the config file and change the
7877
`env` key.
79-
78+
8079
You should also remove the old entry for `twilio` from your `services.php` config, since it's no longer used.
81-
80+
8281
The main breaking change between `2.x` and `3.x` is that failed notification will now throw an exception unless they are
8382
in the list of ignored error codes (publish the config file to edit these).
8483

@@ -188,14 +187,16 @@ $ composer test
188187

189188
## Security
190189

191-
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
190+
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
192191

193192
## Contributing
194193

195194
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
196195

197196
## Credits
198197

198+
- [Philip Iezzi (Pipo)](https://github.com/onlime)
199+
- [Pascal Baljet](https://github.com/pascalbaljet)
199200
- [Gregorio Hernández Caso](https://github.com/gregoriohc)
200201
- [atymic](https://github.com/atymic)
201202
- [All Contributors](../../contributors)

composer.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
"source": "https://github.com/laravel-notification-channels/twilio"
1616
},
1717
"authors": [
18+
{
19+
"name": "Philip Iezzi",
20+
"email": "[email protected]",
21+
"homepage": "https://github.com/onlime",
22+
"role": "Developer"
23+
},
1824
{
1925
"name": "Gregorio Hernández Caso",
2026
"email": "[email protected]",
@@ -29,17 +35,18 @@
2935
}
3036
],
3137
"require": {
32-
"php": ">=7.2|^8.0",
33-
"twilio/sdk": "~6.0|^7.16",
34-
"illuminate/notifications": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0",
35-
"illuminate/support": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0",
36-
"illuminate/events": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0",
37-
"illuminate/queue": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0"
38+
"php": "^8.2",
39+
"twilio/sdk": "^7.16 || ^8.3",
40+
"illuminate/notifications": "^11.0",
41+
"illuminate/support": "^11.0",
42+
"illuminate/events": "^11.0",
43+
"illuminate/queue": "^11.0"
3844
},
3945
"require-dev": {
40-
"mockery/mockery": "^1.3",
41-
"phpunit/phpunit": "^8.5|^9.5|^10.5",
42-
"orchestra/testbench": "^5.0 || ^6.0 || ^7.0 || ^8.0|^9.0"
46+
"laravel/pint": "^1.18",
47+
"mockery/mockery": "^1.0",
48+
"orchestra/testbench": "^9.0",
49+
"phpunit/phpunit": "^10.5"
4350
},
4451
"autoload": {
4552
"psr-4": {
@@ -53,8 +60,8 @@
5360
},
5461
"scripts": {
5562
"test": "vendor/bin/phpunit",
56-
"test:unit": "phpunit --verbose --testsuite Unit",
57-
"test:integration": "phpunit --verbose --testsuite Integration"
63+
"test:unit": "phpunit --testsuite Unit",
64+
"test:integration": "phpunit --testsuite Integration"
5865
},
5966
"config": {
6067
"sort-packages": true

config/twilio-notification-channel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
22

33
return [
4+
'enabled' => (bool) env('TWILIO_ENABLED', true),
45
'username' => env('TWILIO_USERNAME'), // optional when using auth token
56
'password' => env('TWILIO_PASSWORD'), // optional when using auth token
67
'auth_token' => env('TWILIO_AUTH_TOKEN'), // optional when using username and password
78
'account_sid' => env('TWILIO_ACCOUNT_SID'),
89

910
'from' => env('TWILIO_FROM'), // optional
1011
'alphanumeric_sender' => env('TWILIO_ALPHA_SENDER'),
11-
'shorten_urls' => env('TWILIO_SHORTEN_URLS', false), // optional, enable twilio URL shortener
12+
'shorten_urls' => (bool) env('TWILIO_SHORTEN_URLS', false), // optional, enable twilio URL shortener
1213

1314
/**
1415
* See https://www.twilio.com/docs/sms/services.

0 commit comments

Comments
 (0)