Skip to content

Commit 2a81465

Browse files
authored
Merge pull request #14 from ivinteractive/master
Update PHP versions for GitHub Actions workflows
2 parents 9b202d2 + d9b7b1f commit 2a81465

File tree

13 files changed

+71
-87
lines changed

13 files changed

+71
-87
lines changed

.github/workflows/coverage.yml

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

.github/workflows/phpstan.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: PHPStan
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
phpstan:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.2
17+
tools: composer:v2
18+
coverage: none
19+
20+
- name: Install dependencies
21+
run: composer update --prefer-source --no-interaction --no-progress
22+
23+
- name: PHPStan Static Analysis
24+
uses: php-actions/phpstan@v3
25+
with:
26+
path: src/
27+
php_version: 8.2
28+
php_extensions: gd
29+
level: 5

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: true
1212
matrix:
13-
php: [7.2, 7.3, 7.4, 8.0, 8.1]
13+
php: [8.0, 8.1, 8.2]
1414

1515
name: Tests on PHP ${{ matrix.php }} - ${{ matrix.stability }}
1616

@@ -29,4 +29,4 @@ jobs:
2929
run: composer update --prefer-source --no-interaction --no-progress
3030

3131
- name: Execute tests
32-
run: vendor/bin/phpunit --verbose
32+
run: vendor/bin/phpunit --no-coverage

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
composer.phar
44
composer.lock
55
.phpunit.result.cache
6+
.phpunit.cache

.scrutinizer.yml

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

.styleci.yml

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

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/interfax.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/interfax)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
55
[![Build Status](https://img.shields.io/travis/laravel-notification-channels/interfax/master.svg?style=flat-square)](https://travis-ci.org/laravel-notification-channels/interfax)
6-
[![StyleCI](https://styleci.io/repos/232441511/shield)](https://styleci.io/repos/232441511)
7-
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-notification-channels/interfax.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/interfax)
8-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/interfax/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/interfax/?branch=master)
96
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/interfax.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/interfax)
107

118
This package makes it easy to send notifications using [InterFAX](https://interfax.net) with Laravel 6.x and above.
@@ -68,8 +65,9 @@ To use this package, you can create a notification class, like `DocumentWasSent`
6865
<?php
6966
use NotificationChannels\Interfax\InterfaxChannel;
7067
use NotificationChannels\Interfax\InterfaxMessage;
68+
use NotificationChannels\Interfax\Contracts\InterfaxNotificationContract;
7169

72-
class DocumentWasSent extends Notification
70+
class DocumentWasSent extends Notification implements InterfaxNotificationContract
7371
{
7472

7573
protected $files;
@@ -90,7 +88,7 @@ class DocumentWasSent extends Notification
9088
return [InterfaxChannel::class];
9189
}
9290

93-
public function toInterfax($notifiable)
91+
public function toInterfax($notifiable): InterfaxMessage
9492
{
9593
return (new InterfaxMessage)
9694
->files($this->files);

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"mockery/mockery": "^1.0",
2323
"mpdf/mpdf": "^8.0",
2424
"orchestra/testbench": "^7.0|^8.0",
25+
"phpstan/phpstan": "^1.9",
2526
"phpunit/phpunit": "^9.5.10|^10.0"
2627
},
2728
"autoload": {
@@ -38,7 +39,8 @@
3839
"test": [
3940
"@putenv XDEBUG_MODE=coverage",
4041
"vendor/bin/phpunit"
41-
]
42+
],
43+
"phpstan": "vendor/bin/phpstan analyse src --level=5"
4244
},
4345
"config": {
4446
"sort-packages": true
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace NotificationChannels\Interfax\Contracts;
4+
5+
use NotificationChannels\Interfax\InterfaxMessage;
6+
7+
interface InterfaxNotificationContract
8+
{
9+
public function toInterfax($notifiable): InterfaxMessage;
10+
}

src/Exceptions/CouldNotSendNotification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CouldNotSendNotification extends Exception
1010
protected $interfaxMessage;
1111
protected $responseAttributes;
1212

13-
public function __construct($message, $code, Exception $previous = null, InterfaxMessage $interfaxMessage, array $responseAttributes)
13+
final public function __construct(string $message, int $code, Exception $previous = null, InterfaxMessage $interfaxMessage, array $responseAttributes)
1414
{
1515
parent::__construct($message, $code, $previous);
1616

0 commit comments

Comments
 (0)