File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,26 @@ protected function setupWildcardListen($event, $listener)
104
104
*/
105
105
public function hasListeners ($ eventName )
106
106
{
107
- $ hasWildcard = function ($ eventName ) {
108
- foreach ($ this ->wildcards as $ key => $ listeners ) {
109
- if (Str::is ($ key , $ eventName )) {
110
- return true ;
111
- }
112
- }
107
+ return isset ($ this ->listeners [$ eventName ]) ||
108
+ isset ($ this ->wildcards [$ eventName ]) ||
109
+ $ this ->hasWildcardListeners ($ eventName );
110
+ }
113
111
114
- return false ;
115
- };
112
+ /**
113
+ * Determine if the given event has any wildcard listeners.
114
+ *
115
+ * @param string $eventName
116
+ * @return bool
117
+ */
118
+ public function hasWildcardListeners ($ eventName )
119
+ {
120
+ foreach ($ this ->wildcards as $ key => $ listeners ) {
121
+ if (Str::is ($ key , $ eventName )) {
122
+ return true ;
123
+ }
124
+ }
116
125
117
- return isset ( $ this -> listeners [ $ eventName ]) || isset ( $ this -> wildcards [ $ eventName ]) || $ hasWildcard ( $ eventName ) ;
126
+ return false ;
118
127
}
119
128
120
129
/**
You can’t perform that action at this time.
0 commit comments