diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e6b9be..b1c94b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,10 @@ jobs: strategy: fail-fast: true matrix: - php: [7.3, 7.4, 8.0, 8.1] + php: + - 7.4 + - 8.0 + - 8.1 dependencies: - lowest - highest @@ -29,7 +32,7 @@ jobs: coverage: none - name: Composer install - uses: "ramsey/composer-install@v1" + uses: ramsey/composer-install@v1 with: dependency-versions: "${{ matrix.dependencies }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 185db77..56476fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `laravel-notification-channels/pushbullet` will be documented in this file +## 1.4.0 - Unreleased +### Changed +- Bumped PHP requirement to 7.4 + ## 1.3.1 - 2021-12-17 ### Changed - Minor CI improvements diff --git a/composer.json b/composer.json index 3962dc7..ce6df7c 100644 --- a/composer.json +++ b/composer.json @@ -12,14 +12,13 @@ } ], "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0", "guzzlehttp/guzzle": "^6.2 || ^7.0", "illuminate/notifications": "~5.5 || ~6.0 || ~7.0 || ~8.0", "illuminate/support": "~5.5 || ~6.0 || ~7.0 || ~8.0" }, "require-dev": { - "mockery/mockery": "^1.2.0", - "phpunit/phpunit": "^8.5.21 || ^9.0" + "phpunit/phpunit": "^9.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7c9cf9e..f1b35db 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,31 +1,18 @@ - - - - tests - - - - - - src - - - - - - - - - - + + + + + + + + + + + tests + + + + + diff --git a/src/Pushbullet.php b/src/Pushbullet.php index 5f2ac09..4d3c7fa 100644 --- a/src/Pushbullet.php +++ b/src/Pushbullet.php @@ -12,18 +12,10 @@ class Pushbullet { - /** @var string */ - private $token; + private string $token; - /** @var \GuzzleHttp\Client */ - private $httpClient; + private HttpClient $httpClient; - /** - * Create small Pushbullet client. - * - * @param string $token - * @param \GuzzleHttp\Client $httpClient - */ public function __construct(string $token, HttpClient $httpClient) { $this->token = $token; @@ -32,8 +24,6 @@ public function __construct(string $token, HttpClient $httpClient) /** * Get url to send to Pushbullet API? - * - * @return string */ private function getPushbulletUrl(): string { @@ -43,7 +33,7 @@ private function getPushbulletUrl(): string /** * Get headers for API calls. * - * @return array + * @return array */ private function getHeaders(): array { @@ -56,7 +46,6 @@ private function getHeaders(): array * Send request to Pushbullet API. * * @param array $params - * @return \Psr\Http\Message\ResponseInterface */ public function send($params): ResponseInterface { diff --git a/src/PushbulletChannel.php b/src/PushbulletChannel.php index d9bfd66..8445e72 100644 --- a/src/PushbulletChannel.php +++ b/src/PushbulletChannel.php @@ -11,12 +11,8 @@ class PushbulletChannel { - /** @var \NotificationChannels\Pushbullet\Pushbullet */ - private $pushbullet; + private Pushbullet $pushbullet; - /** - * @param \NotificationChannels\Pushbullet\Pushbullet $pushbullet - */ public function __construct(Pushbullet $pushbullet) { $this->pushbullet = $pushbullet; @@ -26,7 +22,6 @@ public function __construct(Pushbullet $pushbullet) * Send the given notification. * * @param mixed $notifiable - * @param \Illuminate\Notifications\Notification $notification * * @throws \NotificationChannels\Pushbullet\Exceptions\CouldNotSendNotification */ @@ -43,8 +38,7 @@ public function send($notifiable, Notification $notification): void } /** - * @param $notifiable - * @return \NotificationChannels\Pushbullet\Targets\Targetable|void + * @param Targetable|string $notifiable */ private function getTarget($notifiable): ?Targetable { diff --git a/src/PushbulletMessage.php b/src/PushbulletMessage.php index 9db6b26..2af345d 100644 --- a/src/PushbulletMessage.php +++ b/src/PushbulletMessage.php @@ -18,8 +18,7 @@ class PushbulletMessage */ public $type = 'note'; - /** @var \NotificationChannels\Pushbullet\Targets\Targetable */ - protected $target; + protected Targetable $target; /** * Notification title. @@ -60,7 +59,6 @@ public function __construct($message) } /** - * @param \NotificationChannels\Pushbullet\Targets\Targetable $targetable * @return $this */ public function target(Targetable $targetable): self @@ -153,9 +151,6 @@ public function toArray(): array ); } - /** - * @return bool - */ private function isLink(): bool { return $this->type === self::TYPE_LINK; diff --git a/src/Targets/Channel.php b/src/Targets/Channel.php index 37afbd5..04b69ae 100644 --- a/src/Targets/Channel.php +++ b/src/Targets/Channel.php @@ -6,21 +6,14 @@ class Channel implements Targetable { - /** - * PushBullet channel tag. - * - * @var string - */ - private $channelTag; + private string $channelTag; /** - * Set channel tag. - * * @param string $channelTag */ public function __construct($channelTag) { - $this->channelTag = $channelTag; + $this->channelTag = (string) $channelTag; } /** diff --git a/src/Targets/Device.php b/src/Targets/Device.php index 8d589f0..8225761 100644 --- a/src/Targets/Device.php +++ b/src/Targets/Device.php @@ -6,21 +6,14 @@ class Device implements Targetable { - /** - * Recipient device id. - * - * @var string - */ - private $deviceId; + private string $deviceId; /** - * Set recipient device id. - * * @param string $device */ public function __construct($device) { - $this->deviceId = $device; + $this->deviceId = (string) $device; } /** diff --git a/src/Targets/Email.php b/src/Targets/Email.php index 085352a..c8cb066 100644 --- a/src/Targets/Email.php +++ b/src/Targets/Email.php @@ -8,12 +8,7 @@ class Email implements Targetable { - /** - * Recipient email. - * - * @var string - */ - private $email; + private string $email; /** * Set recipient email. @@ -26,7 +21,7 @@ public function __construct($email) throw CouldNotSendNotification::providedEmailIsInvalid($email); } - $this->email = $email; + $this->email = (string) $email; } /**