Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang committed Sep 30, 2020
1 parent ba5ab60 commit 19ad946
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ composer.lock
phpunit.xml

var/cache/test/

.phpunit.result.cache
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Configure this Middleware to your MessageBus

#### Register the Bundle if not done automaticaly

```yaml
```php
<?php

return [
Expand All @@ -46,3 +46,49 @@ framework:
middleware:
- jhyangxyz.messenger_version_control.middleware.version_checker_middleware
```
#### Configure a Message
```php
<?php

namespace App\Message;

use Jhyangxyz\MessengerVersionControl\Message\AbstractVersionedMessage;

final class FooMessage extends AbstractVersionedMessage
{
public function __construct()
{
$this->setVersion();
}

public function getBuildVersion(): int
{
return 1;
}
}
```

#### Configure a MessageHandler

```php
<?php

namespace App\MessageHandler;


use Jhyangxyz\MessengerVersionControl\MessageHandler\AbstractVersionedMessageHandler;


final class FooMessageHandler extends AbstractVersionedMessageHandler
{
public function __invoke(FooMessage $message)
{
$this->checkVersion($message);

//Handle message
...
}
}
```

0 comments on commit 19ad946

Please sign in to comment.