Skip to content

Commit

Permalink
Add support symfony/event-dispatcher-contracts version ^3.0 (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Jul 4, 2022
1 parent 43db319 commit 026e5ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Expand Up @@ -2,17 +2,17 @@

## 1.1.1 under development

- no changes in this release.
- Enh #156: Add support for `symfony/event-dispatcher-contracts` of version `^3.0` (@vjik)

## 1.1.0 May 03, 2022

- Chg #148: Raise the minimum PHP version to 8.0 (rustamwin)
- Enh #149: Add bash completion for `serve` command, serve at 127.0.0.1 by default (rustamwin)
- Chg #148: Raise the minimum PHP version to 8.0 (@rustamwin)
- Enh #149: Add bash completion for `serve` command, serve at 127.0.0.1 by default (@rustamwin)

## 1.0.1 February 11, 2022

- Enh #141: Add support for version `^6.0` for `symfony/console` package (devanych)
- Bug #145: Add return type to `Yiisoft\Yii\Console\CommandLoader::get()` method (devanych)
- Enh #141: Add support for version `^6.0` for `symfony/console` package (@devanych)
- Bug #145: Add return type to `Yiisoft\Yii\Console\CommandLoader::get()` method (@devanych)

## 1.0.0 November 01, 2021

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -30,7 +30,7 @@
"php": "^8.0",
"psr/container": "^1.0|^2.0",
"symfony/console": "^5.4|^6.0",
"symfony/event-dispatcher-contracts": "^2.2",
"symfony/event-dispatcher-contracts": "^2.2|^3.0",
"yiisoft/friendly-exception": "^1.0"
},
"require-dev": {
Expand Down
8 changes: 8 additions & 0 deletions src/SymfonyEventDispatcher.php
Expand Up @@ -16,8 +16,16 @@ public function __construct(PsrEventDispatcherInterface $dispatcher)
$this->dispatcher = $dispatcher;
}

/**
* Dispatches an event to all registered listeners.
*
* @psalm-template T as object
* @psalm-param T $event
* @psalm-return T
*/
public function dispatch(object $event, string $eventName = null): object
{
/** @psalm-var T */
return $this->dispatcher->dispatch($event);
}
}

0 comments on commit 026e5ea

Please sign in to comment.