File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1313 "require" : {
1414 "php" : " >=7.4" ,
1515 "nette/application" : " ^3.0" ,
16- "nette/caching" : " ^3.0"
16+ "nette/caching" : " ^3.0" ,
17+ "nette/utils" : " ^3.0"
1718 },
1819 "autoload" : {
1920 "psr-4" : {
Original file line number Diff line number Diff line change 44
55namespace Infinityloop \ObserverComponent ;
66
7- class EventMapper
7+ final class EventMapper
88{
9+ use Nette \SmartObject;
10+
911 private \Nette \Application \Application $ application ;
1012 private \Nette \Caching \IStorage $ storage ;
1113 private ?\Nette \Caching \Cache $ eventMap = null ;
1214 private bool $ debugMode ;
1315
1416 public function __construct (
1517 \Nette \Application \Application $ application ,
16- \Nette \Caching \IStorage $ storage
18+ \Nette \Caching \IStorage $ storage ,
19+ bool $ debugMode
1720 )
1821 {
1922 $ this ->application = $ application ;
2023 $ this ->storage = $ storage ;
21- $ this ->debugMode = \ App \Bootstrap:: isDebugMode () ;
24+ $ this ->debugMode = $ debugMode ;
2225 }
2326
2427 public function registerObserver (IObserverComponent $ component ) : void
@@ -65,7 +68,8 @@ public function dispatchEvent(IEvent $event) : void
6568
6669 private function getObserverList (string $ eventName ) : array
6770 {
68- return $ this ->getEventMap ()->load ($ eventName ) ?? [];
71+ return $ this ->getEventMap ()->load ($ eventName )
72+ ?? [];
6973 }
7074
7175 private function isComponentRegistered (string $ componentPath ) : bool
You can’t perform that action at this time.
0 commit comments