FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpunit-wrapper/src/DispatcherWrapper.php at 9.0 · Codeception/phpunit-wrapper · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Codeception
/
phpunit-wrapper
Public archive
Notifications
You must be signed in to change notification settings
Fork
30
Star
239
Code
Issues
2
Pull requests
1
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
phpunit-wrapper
/
src
/
DispatcherWrapper.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 975 Bytes
Breadcrumbs
phpunit-wrapper
/
src
/
DispatcherWrapper.php
Copy path
File metadata and controls
29 lines (25 loc) · 975 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
namespace
Codeception
\
PHPUnit
;
use
Symfony
\
Component
\
EventDispatcher
\
Event
;
use
Symfony
\
Component
\
EventDispatcher
\
EventDispatcher
;
use
Symfony
\
Contracts
\
EventDispatcher
\
EventDispatcherInterface
as
ContractsEventDispatcherInterface
;
trait
DispatcherWrapper
{
/**
* Compatibility wrapper for dispatcher change between Symfony 4 and 5
* @param EventDispatcher $dispatcher
* @param string $eventType
* @param Event $eventObject
*/
protected
function
dispatch
(
EventDispatcher
$
dispatcher
,
$
eventType
,
Event
$
eventObject
)
{
// The `EventDispatcherInterface` of `Symfony\Contracts` is only implemented in Symfony 4.3 or higher
if
(
$
dispatcher
instanceof
ContractsEventDispatcherInterface) {
//Symfony 4.3 or higher
$
dispatcher
->
dispatch
(
$
eventObject
,
$
eventType
);
}
else
{
//Symfony 4.2 or lower
$
dispatcher
->
dispatch
(
$
eventType
,
$
eventObject
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL