Skip to content

Commit

Permalink
release 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jleonardolemos committed Oct 22, 2020
1 parent 99545bb commit ad0c4b7
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 29 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Properties on publish method
### Added
- Laravel 8 support
### Changed
- Change `emmit` method name to `dispatch`
## [v1.6.0]
### Added
- Added RPCs test
Expand All @@ -25,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Catch `Throwble` instead of `Exception` on default fallback
### Fixed
- Fixed support for Laravel 6
- Fixed facade `dispatch` signature
- Fixed facade `emmit` signature

## [v1.4.1]
### Removed
Expand Down Expand Up @@ -66,7 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.2.0-beta.1]
### Added
- Add `application_headers` to `Pigeon::dispatch` as last parameter
- Add `application_headers` to `Pigeon::emmit` as last parameter
- Add configurable precondition catch on queue creation
### Fixed
- Auto declare exchange with `routing`
Expand Down
11 changes: 0 additions & 11 deletions docs/UPGRADE.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/Drivers/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function routing(string $name = null): PublisherContract
return (new Publisher($this->app, $this, $exchange))->routing($name);
}

public function dispatch(string $eventName, array $event, array $meta = []): void
public function emmit(string $eventName, array $event, array $meta = []): void
{
throw_if(empty($event), new EmptyEventException());
$publisher = $this->exchange(self::EVENT_EXCHANGE, self::EVENT_EXCHANGE_TYPE)->routing($eventName);
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/DriverContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function exchange(string $name, string $type): PublisherContract;

public function events(string $event = '*'): ConsumerContract;

public function dispatch(string $eventName, array $event, array $meta = []): void;
public function emmit(string $eventName, array $event, array $meta = []): void;

public function routing(string $name): PublisherContract;

Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/Events/EmptyEventException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class EmptyEventException extends Exception
{
public function __construct($message = 'Cannot dispatch empty event', $code = 0, Throwable $previous = null)
public function __construct($message = 'Cannot emmit empty event', $code = 0, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Facade/Pigeon.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @method static \Convenia\Pigeon\Drivers\Driver driver(string $driver)
* @method static \Convenia\Pigeon\Publisher\PublisherContract routing(string $name = null)
* @method static \Convenia\Pigeon\Publisher\PublisherContract exchange(string $name, string $type = 'direct')
* @method static \Convenia\Pigeon\Publisher\PublisherContract dispatch(string $eventName, array $event, array $meta = [])
* @method static \Convenia\Pigeon\Publisher\PublisherContract emmit(string $eventName, array $event, array $meta = [])
* @method static \Convenia\Pigeon\Consumer\ConsumerContract queue(string $name, array $properties = [])
* @method static \Convenia\Pigeon\Consumer\ConsumerContract events(string $name = '#')
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Testing/PigeonFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function events(string $event = '#'): ConsumerContract
return $consumer;
}

public function dispatch(string $eventName, array $event, array $meta = []): void
public function emmit(string $eventName, array $event, array $meta = []): void
{
$this->events->push([
'event' => $eventName,
Expand Down
2 changes: 1 addition & 1 deletion tests/Bugs/Bug85.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ public function test_it_should_publish_events_using_same_channel_id()
->with(3)
->andReturn($this->channel);

$this->driver->dispatch('anything', ['foo' => 'bar']);
$this->driver->emmit('anything', ['foo' => 'bar']);
}
}
4 changes: 2 additions & 2 deletions tests/Integration/Driver/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function test_it_should_publish_event()
$this->channel->queue_bind($this->queue, Driver::EVENT_EXCHANGE, $event_name);

// act
$this->driver->dispatch($event_name, $event_content);
$this->driver->emmit($event_name, $event_content);

sleep(1);

Expand All @@ -65,7 +65,7 @@ public function test_it_should_publish_event_with_meta()
$this->channel->queue_bind($this->queue, Driver::EVENT_EXCHANGE, $event_name);

// act
$this->driver->dispatch($event_name, $event_content, $meta);
$this->driver->emmit($event_name, $event_content, $meta);

sleep(1);

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Publisher/PublisherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function test_it_should_publish_event()
$this->assertNull($received);

// act
$this->pigeon->dispatch($event_name, $event_data);
$this->pigeon->emmit($event_name, $event_data);

sleep(1);
// assert
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/DriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function test_it_should_publish_event()
)->once();

// act
$this->driver->dispatch($event_name, $event_content);
$this->driver->emmit($event_name, $event_content);
}

public function test_it_should_publish_event_with_headers()
Expand Down Expand Up @@ -163,7 +163,7 @@ function ($message, $exchange, $event) use ($key, $value, $event_name) {
)->once();

// act
$this->driver->dispatch($event_name, $event_content, $meta);
$this->driver->emmit($event_name, $event_content, $meta);
}

public function test_it_should_not_publish_empty_event()
Expand All @@ -173,10 +173,10 @@ public function test_it_should_not_publish_empty_event()
$event_content = [];

// assert
$this->expectExceptionMessage('Cannot dispatch empty event');
$this->expectExceptionMessage('Cannot emmit empty event');

// act
$this->driver->dispatch($event_name, $event_content);
$this->driver->emmit($event_name, $event_content);
}

public function test_it_should_declare_bind_event_queue_and_return_consumer()
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/PigeonFakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function test_it_should_assert_event_emitted()
} catch (ExpectationFailedException $e) {
$this->assertThat($e, new ExceptionMessage("No event [$category] emitted with body"));
}
$this->fake->dispatch($category, $data);
$this->fake->emmit($category, $data);

$this->fake->assertEmitted($category, $data);
}
Expand Down

0 comments on commit ad0c4b7

Please sign in to comment.