From ea7ce6f155add884d8bbc6e06ef9b5ce85497ffd Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 13:50:06 +0100 Subject: [PATCH 01/10] fix to Laravel 8, add function return types, rename dummy test classes --- .github/workflows/run-tests.yml | 5 +---- CHANGELOG.md | 4 ---- CONTRIBUTING.md | 2 -- README.md | 17 +++++++++-------- composer.json | 2 +- src/BroadcastableModelEventOccurred.php | 2 +- src/Broadcasters/SnsBroadcaster.php | 3 ++- src/BroadcastsEvents.php | 4 ++-- src/SnsBroadcasterServiceProvider.php | 4 ++-- ...h.php => UserRetrievedWithCustomPayload.php} | 2 +- ...WithBroadcastingEventsForSpecificEvents.php} | 2 +- ...WithBroadcastingEventsWithCustomPayload.php} | 2 +- ...ventsWithCustomPayloadForSpecificEvents.php} | 2 +- tests/Unit/CustomEventsTest.php | 4 ++-- tests/Unit/ModelEventsTest.php | 14 +++++++------- 15 files changed, 31 insertions(+), 38 deletions(-) rename tests/Dummies/Events/{UserRetrievedWithBroadcastWith.php => UserRetrievedWithCustomPayload.php} (94%) rename tests/Dummies/Models/{UserWithBroadcastingEventsWithBroadcastEvents.php => UserWithBroadcastingEventsForSpecificEvents.php} (88%) rename tests/Dummies/Models/{UserWithBroadcastingEventsWithBroadcastWith.php => UserWithBroadcastingEventsWithCustomPayload.php} (90%) rename tests/Dummies/Models/{UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents.php => UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents.php} (90%) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9a37427..6cf1d4a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,11 +8,8 @@ jobs: strategy: fail-fast: true matrix: - php: [ 7.4, 8.0 ] + php: [ 7.3, 8.0 ] laravel: [ 8.* ] - include: - - laravel: 8.* - testbench: 6.* name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb0d31..3f8d1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,3 @@ # Changelog All notable changes to `laravel-sns-broadcast-driver` will be documented in this file. - -## 0.1.0 - 2021-06-30 - -- first release diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4ae1c4..e5da36d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,8 +38,6 @@ Before submitting a pull request: ## Requirements -If the project maintainer has any additional requirements, you will find them listed here. - - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer). - **Add tests!** - Your patch won't be accepted if it doesn't have tests. diff --git a/README.md b/README.md index b0fa9e8..b24364b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel SNS Broadcaster +# Laravel 8 SNS Broadcaster [![Latest Version on Packagist](https://img.shields.io/packagist/v/pod-point/laravel-sns-broadcast-driver.svg?style=flat-square)](https://packagist.org/packages/pod-point/laravel-sns-broadcast-driver) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pod-point/laravel-sns-broadcast-driver/run-tests?label=tests) @@ -27,7 +27,7 @@ Add the sns driver to `config/broadcasting.php` in the `connections` array: ], ``` -Update the `.env` to use the driver and add the AWS values: +Update your `.env` to use the driver and add the AWS values: ```dotenv BROADCAST_DRIVER=sns @@ -74,7 +74,7 @@ public function broadcastOn($event) By default, the package will publish the default Laravel payload, but you can transform the data that is published by transforming the data using `broadcastWith`. -Here you, can define exactly what payload gets published. +Here you can define exactly what payload gets published. The `broadcastWith()` method receives an `$event` parameter that specifies the type of action performed, e.g. created. @@ -98,11 +98,11 @@ public function broadcastWith($event) #### Defining which actions are publishable -By default, the following actions performed on a Model will be published: +By default, the following actions performed on a Model will be published: -`created`, `updated`, `deleted` and if soft delete is enabled, `trashed`, `restored`. +`created`, `updated`, `deleted` and if soft delete is enabled: `trashed`, `restored`. -To only publish specific actions from the list above, add a `broadcastEvents` method the model and define an array of the publishable actions: +To only publish specific actions from the list above, add a `broadcastEvents` method to the model and define an array of the publishable actions: ```injectablephp /** @@ -116,7 +116,7 @@ public function broadcastEvents() } ``` -Now, only the created and updated events for this Model will be published. +Now only the created and updated events for this Model will be published. ### Custom Events @@ -146,6 +146,7 @@ public function broadcastOn() ``` #### Customizing the published data + By default, all public properties on the Event will be added to the payload that is published. Unlike a Model Event, you will need to manually set an action as a public property to the Event if you wish to see it in the payload. @@ -246,7 +247,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details. ## Credits - [laravel-sns-broadcaster](https://github.com/maxgaurav/laravel-sns-broadcaster) for some inspiration -- [Laravel Package Development](https://laravelpackage.com) documentation by [John Braun](https://github.com/Jhnbrn90) +- [Laravel Package Development](https://laravelpackage.com) documentation by [John Braun](https://github.com/Jhnbrn90) - [Pod Point](https://github.com/pod-point) - [All Contributors](https://github.com/pod-point/laravel-sns-broadcast-driver/graphs/contributors) diff --git a/composer.json b/composer.json index 05f0088..b1ee23c 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require": { - "php": "^7.4|^8.0", + "php": "^7.3|^8.0", "ext-json": "*", "illuminate/support": "^8.0", "aws/aws-sdk-php-laravel": "^3.6" diff --git a/src/BroadcastableModelEventOccurred.php b/src/BroadcastableModelEventOccurred.php index 3be13ab..082e3e5 100644 --- a/src/BroadcastableModelEventOccurred.php +++ b/src/BroadcastableModelEventOccurred.php @@ -11,7 +11,7 @@ class BroadcastableModelEventOccurred extends EloquentBroadcastableModelEventOcc * * @return array */ - public function broadcastWith() + public function broadcastWith(): array { return method_exists($this->model, 'broadcastWith') ? $this->model->broadcastWith($this->event) : [ 'model' => $this->model->toArray(), diff --git a/src/Broadcasters/SnsBroadcaster.php b/src/Broadcasters/SnsBroadcaster.php index d360977..8e22e18 100644 --- a/src/Broadcasters/SnsBroadcaster.php +++ b/src/Broadcasters/SnsBroadcaster.php @@ -34,8 +34,9 @@ public function __construct(string $arnPrefix) * @param array $channels * @param $event * @param array $payload + * @return void */ - public function broadcast(array $channels, $event, array $payload = []) + public function broadcast(array $channels, $event, array $payload = []): void { $this->snsClient->publish([ 'TopicArn' => $this->topicName($channels), diff --git a/src/BroadcastsEvents.php b/src/BroadcastsEvents.php index 9a3c18e..95494cb 100644 --- a/src/BroadcastsEvents.php +++ b/src/BroadcastsEvents.php @@ -42,7 +42,7 @@ public function newBroadcastableModelEvent($event) * @param mixed $channels * @return \Illuminate\Broadcasting\PendingBroadcast|null|void */ - protected function broadcastIfBroadcastChannelsExistForEvent($instance, $event, $channels = null) + protected function broadcastIfBroadcastChannelsExistForEvent($instance, string $event, $channels = null) { if (in_array($event, $this->broadcastEvents())) { return $this->eloquentBroadcastIfBroadcastChannelsExistForEvent($instance, $event, $channels); @@ -54,7 +54,7 @@ protected function broadcastIfBroadcastChannelsExistForEvent($instance, $event, * * @return array */ - public function broadcastEvents() + public function broadcastEvents(): array { return ['created', 'updated', 'trashed', 'restored', 'deleted']; } diff --git a/src/SnsBroadcasterServiceProvider.php b/src/SnsBroadcasterServiceProvider.php index c8e1dc4..3b83e48 100644 --- a/src/SnsBroadcasterServiceProvider.php +++ b/src/SnsBroadcasterServiceProvider.php @@ -17,7 +17,7 @@ class SnsBroadcasterServiceProvider extends ServiceProvider * * @return void */ - public function register() + public function register(): void { $this->app->bind(EloquentBroadcastableModelEventOccurred::class, BroadcastableModelEventOccurred::class); } @@ -28,7 +28,7 @@ public function register() * @return void * @throws BindingResolutionException */ - public function boot() + public function boot(): void { $this->app->singleton(SnsClient::class, function () { $config = [ diff --git a/tests/Dummies/Events/UserRetrievedWithBroadcastWith.php b/tests/Dummies/Events/UserRetrievedWithCustomPayload.php similarity index 94% rename from tests/Dummies/Events/UserRetrievedWithBroadcastWith.php rename to tests/Dummies/Events/UserRetrievedWithCustomPayload.php index 558ab6c..888924f 100644 --- a/tests/Dummies/Events/UserRetrievedWithBroadcastWith.php +++ b/tests/Dummies/Events/UserRetrievedWithCustomPayload.php @@ -8,7 +8,7 @@ use Illuminate\Queue\SerializesModels; use PodPoint\SnsBroadcaster\Tests\Dummies\Models\User; -class UserRetrievedWithBroadcastWith implements ShouldBroadcast +class UserRetrievedWithCustomPayload implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; diff --git a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastEvents.php b/tests/Dummies/Models/UserWithBroadcastingEventsForSpecificEvents.php similarity index 88% rename from tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastEvents.php rename to tests/Dummies/Models/UserWithBroadcastingEventsForSpecificEvents.php index bb0e753..ca8a93a 100644 --- a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastEvents.php +++ b/tests/Dummies/Models/UserWithBroadcastingEventsForSpecificEvents.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model; use PodPoint\SnsBroadcaster\BroadcastsEvents; -class UserWithBroadcastingEventsWithBroadcastEvents extends Model +class UserWithBroadcastingEventsForSpecificEvents extends Model { use BroadcastsEvents; diff --git a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWith.php b/tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayload.php similarity index 90% rename from tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWith.php rename to tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayload.php index 5b10a4f..b2246ac 100644 --- a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWith.php +++ b/tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayload.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model; use PodPoint\SnsBroadcaster\BroadcastsEvents; -class UserWithBroadcastingEventsWithBroadcastWith extends Model +class UserWithBroadcastingEventsWithCustomPayload extends Model { use BroadcastsEvents; diff --git a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents.php b/tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents.php similarity index 90% rename from tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents.php rename to tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents.php index 7d29477..29995fe 100644 --- a/tests/Dummies/Models/UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents.php +++ b/tests/Dummies/Models/UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents.php @@ -5,7 +5,7 @@ use Illuminate\Database\Eloquent\Model; use PodPoint\SnsBroadcaster\BroadcastsEvents; -class UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents extends Model +class UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents extends Model { use BroadcastsEvents; diff --git a/tests/Unit/CustomEventsTest.php b/tests/Unit/CustomEventsTest.php index 7bf307a..35620fa 100644 --- a/tests/Unit/CustomEventsTest.php +++ b/tests/Unit/CustomEventsTest.php @@ -5,7 +5,7 @@ use Aws\Sns\SnsClient; use Mockery; use PodPoint\SnsBroadcaster\Tests\Dummies\Events\UserRetrieved; -use PodPoint\SnsBroadcaster\Tests\Dummies\Events\UserRetrievedWithBroadcastWith; +use PodPoint\SnsBroadcaster\Tests\Dummies\Events\UserRetrievedWithCustomPayload; use PodPoint\SnsBroadcaster\Tests\Dummies\Models\User; use PodPoint\SnsBroadcaster\Tests\TestCase; @@ -63,6 +63,6 @@ public function test_broadcasts_custom_event_with_custom_payload() && $message['data']['foo'] == 'baz'; })); - event(new UserRetrievedWithBroadcastWith($user)); + event(new UserRetrievedWithCustomPayload($user)); } } diff --git a/tests/Unit/ModelEventsTest.php b/tests/Unit/ModelEventsTest.php index 3cbd1b5..255f67f 100644 --- a/tests/Unit/ModelEventsTest.php +++ b/tests/Unit/ModelEventsTest.php @@ -5,9 +5,9 @@ use Aws\Sns\SnsClient; use Mockery; use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEvents; -use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsWithBroadcastEvents; -use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsWithBroadcastWith; -use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents; +use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsForSpecificEvents; +use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsWithCustomPayload; +use PodPoint\SnsBroadcaster\Tests\Dummies\Models\UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents; use PodPoint\SnsBroadcaster\Tests\TestCase; class ModelEventsTest extends TestCase @@ -60,7 +60,7 @@ public function test_broadcasts_model_event_with_custom_payload() && $message['data']['foo'] == 'bar'; })); - UserWithBroadcastingEventsWithBroadcastWith::create($userData); + UserWithBroadcastingEventsWithCustomPayload::create($userData); } /** @test */ @@ -70,7 +70,7 @@ public function test_broadcasts_model_event_with_specified_event() $this->app->instance(SnsClient::class, $mocked); - $user = UserWithBroadcastingEventsWithBroadcastEvents::create([ + $user = UserWithBroadcastingEventsForSpecificEvents::create([ 'name' => 'Foo Bar', 'email' => 'model-event-3@email.com', 'password' => 'password', @@ -96,7 +96,7 @@ public function test_does_not_broadcast_model_event_without_specified_event() $mocked->shouldNotHaveReceived('publish'); - $user = UserWithBroadcastingEventsWithBroadcastEvents::create([ + $user = UserWithBroadcastingEventsForSpecificEvents::create([ 'name' => 'Foo Bar', 'email' => 'model-event-4@email.com', 'password' => 'password', @@ -112,7 +112,7 @@ public function test_broadcasts_model_event_with_specified_event_and_custom_payl $this->app->instance(SnsClient::class, $mocked); - $user = UserWithBroadcastingEventsWithBroadcastWithAndBroadcastEvents::create([ + $user = UserWithBroadcastingEventsWithCustomPayloadForSpecificEvents::create([ 'name' => 'Foo Bar', 'email' => 'model-event-5@email.com', 'password' => 'password', From 404ebbbdaf36fc171dc0b0fae436b13d5e79c05d Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 14:01:14 +0100 Subject: [PATCH 02/10] remove orchestra testbench from github actions composer require --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 6cf1d4a..ab2c878 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-progress - name: Execute tests From e9119877ef7943769dd6a897260dc1c55042d7da Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 14:26:59 +0100 Subject: [PATCH 03/10] update README with new repo name --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b24364b..8686370 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Laravel 8 SNS Broadcaster -[![Latest Version on Packagist](https://img.shields.io/packagist/v/pod-point/laravel-sns-broadcast-driver.svg?style=flat-square)](https://packagist.org/packages/pod-point/laravel-sns-broadcast-driver) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pod-point/laravel-sns-broadcast-driver/run-tests?label=tests) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/pod-point/laravel-sns-broadcaster.svg?style=flat-square)](https://packagist.org/packages/pod-point/laravel-sns-broadcaster) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/pod-point/laravel-sns-broadcaster/run-tests?label=tests) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Total Downloads](https://img.shields.io/packagist/dt/pod-point/laravel-sns-broadcast-driver.svg?style=flat-square)](https://packagist.org/packages/pod-point/laravel-sns-broadcast-driver) +[![Total Downloads](https://img.shields.io/packagist/dt/pod-point/laravel-sns-broadcaster.svg?style=flat-square)](https://packagist.org/packages/pod-point/laravel-sns-broadcaster) This package adds support for broadcasting events via SNS (Simple Notification Service). @@ -249,7 +249,7 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - [laravel-sns-broadcaster](https://github.com/maxgaurav/laravel-sns-broadcaster) for some inspiration - [Laravel Package Development](https://laravelpackage.com) documentation by [John Braun](https://github.com/Jhnbrn90) - [Pod Point](https://github.com/pod-point) -- [All Contributors](https://github.com/pod-point/laravel-sns-broadcast-driver/graphs/contributors) +- [All Contributors](https://github.com/pod-point/laravel-sns-broadcaster/graphs/contributors) ## License From d70f9c4814f57a6a503d35d6b5eef0af1a65dc44 Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 15:02:33 +0100 Subject: [PATCH 04/10] add phpunit.xml.dist --- phpunit.xml.dist | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 phpunit.xml.dist diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..167e3f8 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./tests/ + + + From 18a6589cf4fededa8a1a2ed9875c1ba015de3037 Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 15:13:20 +0100 Subject: [PATCH 05/10] remove const type for php 7.3 --- tests/Dummies/Events/UserRetrieved.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Dummies/Events/UserRetrieved.php b/tests/Dummies/Events/UserRetrieved.php index 79998b1..525632a 100644 --- a/tests/Dummies/Events/UserRetrieved.php +++ b/tests/Dummies/Events/UserRetrieved.php @@ -12,9 +12,9 @@ class UserRetrieved implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; - public string $action = 'RETRIEVED'; + public $action = 'RETRIEVED'; - public string $foo = 'bar'; + public $foo = 'bar'; /** * @var User From 5f0a8815fef6372860696be339a3085597f81301 Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 15:15:01 +0100 Subject: [PATCH 06/10] remove const types for php 7.3 v2 --- tests/Dummies/Events/UserRetrieved.php | 2 +- tests/Dummies/Events/UserRetrievedWithCustomPayload.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Dummies/Events/UserRetrieved.php b/tests/Dummies/Events/UserRetrieved.php index 525632a..d7e33bd 100644 --- a/tests/Dummies/Events/UserRetrieved.php +++ b/tests/Dummies/Events/UserRetrieved.php @@ -19,7 +19,7 @@ class UserRetrieved implements ShouldBroadcast /** * @var User */ - public User $user; + public $user; /** * Create a new event instance. diff --git a/tests/Dummies/Events/UserRetrievedWithCustomPayload.php b/tests/Dummies/Events/UserRetrievedWithCustomPayload.php index 888924f..b0e10ee 100644 --- a/tests/Dummies/Events/UserRetrievedWithCustomPayload.php +++ b/tests/Dummies/Events/UserRetrievedWithCustomPayload.php @@ -12,12 +12,12 @@ class UserRetrievedWithCustomPayload implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; - public string $action = 'RETRIEVED'; + public $action = 'RETRIEVED'; /** * @var User */ - public User $user; + public $user; /** * Create a new event instance. From 0003485a4cbb252e4fb9d3c7a6cb89b3148b9cec Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 15:17:05 +0100 Subject: [PATCH 07/10] remove const types for php7.3 v3 --- src/Broadcasters/SnsBroadcaster.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Broadcasters/SnsBroadcaster.php b/src/Broadcasters/SnsBroadcaster.php index 8e22e18..8c86213 100644 --- a/src/Broadcasters/SnsBroadcaster.php +++ b/src/Broadcasters/SnsBroadcaster.php @@ -11,12 +11,12 @@ class SnsBroadcaster extends Broadcaster /** * @var SnsClient */ - protected SnsClient $snsClient; + protected $snsClient; /** * @var string */ - protected string $arnPrefix; + protected $arnPrefix; /** * SnsBroadcaster constructor. From 32c245bd5a2fd1fd7ab85a9fb8da3d8f1033c5c6 Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Mon, 12 Jul 2021 16:31:54 +0100 Subject: [PATCH 08/10] remove double spaces in docblock --- src/Broadcasters/SnsBroadcaster.php | 6 +++--- src/BroadcastsEvents.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Broadcasters/SnsBroadcaster.php b/src/Broadcasters/SnsBroadcaster.php index 8c86213..0562b86 100644 --- a/src/Broadcasters/SnsBroadcaster.php +++ b/src/Broadcasters/SnsBroadcaster.php @@ -31,9 +31,9 @@ public function __construct(string $arnPrefix) /** * @inheritDoc - * @param array $channels - * @param $event - * @param array $payload + * @param array $channels + * @param string $event + * @param array $payload * @return void */ public function broadcast(array $channels, $event, array $payload = []): void diff --git a/src/BroadcastsEvents.php b/src/BroadcastsEvents.php index 95494cb..dec66c6 100644 --- a/src/BroadcastsEvents.php +++ b/src/BroadcastsEvents.php @@ -37,9 +37,9 @@ public function newBroadcastableModelEvent($event) /** * Broadcast the given event instance if channels are configured for the model event. * - * @param mixed $instance - * @param string $event - * @param mixed $channels + * @param mixed $instance + * @param string $event + * @param mixed $channels * @return \Illuminate\Broadcasting\PendingBroadcast|null|void */ protected function broadcastIfBroadcastChannelsExistForEvent($instance, string $event, $channels = null) From bbe589455ca3628dde0d5baceb63eacfcd0b09ad Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Tue, 13 Jul 2021 11:10:19 +0100 Subject: [PATCH 09/10] remove double spaces in docblock --- src/Broadcasters/SnsBroadcaster.php | 4 ++-- src/BroadcastsEvents.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Broadcasters/SnsBroadcaster.php b/src/Broadcasters/SnsBroadcaster.php index 0562b86..4b612f0 100644 --- a/src/Broadcasters/SnsBroadcaster.php +++ b/src/Broadcasters/SnsBroadcaster.php @@ -31,9 +31,9 @@ public function __construct(string $arnPrefix) /** * @inheritDoc - * @param array $channels + * @param array $channels * @param string $event - * @param array $payload + * @param array $payload * @return void */ public function broadcast(array $channels, $event, array $payload = []): void diff --git a/src/BroadcastsEvents.php b/src/BroadcastsEvents.php index dec66c6..ac691ab 100644 --- a/src/BroadcastsEvents.php +++ b/src/BroadcastsEvents.php @@ -37,9 +37,9 @@ public function newBroadcastableModelEvent($event) /** * Broadcast the given event instance if channels are configured for the model event. * - * @param mixed $instance - * @param string $event - * @param mixed $channels + * @param mixed $instance + * @param string $event + * @param mixed $channels * @return \Illuminate\Broadcasting\PendingBroadcast|null|void */ protected function broadcastIfBroadcastChannelsExistForEvent($instance, string $event, $channels = null) From f78c311328d826a1a22c7f081bae6371d227ee15 Mon Sep 17 00:00:00 2001 From: Hasnat Hoque Date: Tue, 13 Jul 2021 11:19:25 +0100 Subject: [PATCH 10/10] add changelog release 0.1.0 notes --- CHANGELOG.md | 6 +++++- composer.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f8d1ad..0fe5bb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ # Changelog -All notable changes to `laravel-sns-broadcast-driver` will be documented in this file. +All notable changes to `laravel-sns-broadcaster` will be documented in this file. + +## 0.1.0 - 2021-07-13 + +- First release supporting PHP7.3+ and Laravel 8+ diff --git a/composer.json b/composer.json index b1ee23c..2be117c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "pod-point/laravel-sns-broadcaster", "description": "A broadcast driver that allows broadcast events to be published to SNS.", "keywords": ["laravel", "sns", "broadcast"], - "homepage": "https://github.com/pod-point/laravel-sns-broadcast-driver", + "homepage": "https://github.com/pod-point/laravel-sns-broadcaster", "license": "MIT", "authors": [ {