File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -852,9 +852,7 @@ public function beforeExecuting(Closure $callback)
852
852
*/
853
853
public function listen (Closure $ callback )
854
854
{
855
- if (isset ($ this ->events )) {
856
- $ this ->events ->listen (Events \QueryExecuted::class, $ callback );
857
- }
855
+ $ this ->events ?->listen(Events \QueryExecuted::class, $ callback );
858
856
}
859
857
860
858
/**
@@ -865,11 +863,7 @@ public function listen(Closure $callback)
865
863
*/
866
864
protected function fireConnectionEvent ($ event )
867
865
{
868
- if (! isset ($ this ->events )) {
869
- return ;
870
- }
871
-
872
- return $ this ->events ->dispatch (match ($ event ) {
866
+ return $ this ->events ?->dispatch(match ($ event ) {
873
867
'beganTransaction ' => new TransactionBeginning ($ this ),
874
868
'committed ' => new TransactionCommitted ($ this ),
875
869
'rollingBack ' => new TransactionRolledBack ($ this ),
@@ -885,9 +879,7 @@ protected function fireConnectionEvent($event)
885
879
*/
886
880
protected function event ($ event )
887
881
{
888
- if (isset ($ this ->events )) {
889
- $ this ->events ->dispatch ($ event );
890
- }
882
+ $ this ->events ?->dispatch($ event );
891
883
}
892
884
893
885
/**
Original file line number Diff line number Diff line change @@ -132,9 +132,7 @@ public function command($method, array $parameters = [])
132
132
*/
133
133
protected function event ($ event )
134
134
{
135
- if (isset ($ this ->events )) {
136
- $ this ->events ->dispatch ($ event );
137
- }
135
+ $ this ->events ?->dispatch($ event );
138
136
}
139
137
140
138
/**
@@ -145,9 +143,7 @@ protected function event($event)
145
143
*/
146
144
public function listen (Closure $ callback )
147
145
{
148
- if (isset ($ this ->events )) {
149
- $ this ->events ->listen (CommandExecuted::class, $ callback );
150
- }
146
+ $ this ->events ?->listen(CommandExecuted::class, $ callback );
151
147
}
152
148
153
149
/**
You can’t perform that action at this time.
0 commit comments