File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,26 @@ public function addListener(ListenerInterface $listener)
7777 return $ this ;
7878 }
7979
80+ /**
81+ * {@inheritDoc}
82+ */
83+ public function getListener ($ name )
84+ {
85+ if (!$ this ->isListener ($ name )) {
86+ throw new \InvalidArgumentException (sprintf ('Unknown listener %s ' , $ name ));
87+ }
88+
89+ return $ this ->listeners [$ name ];
90+ }
91+
92+ /**
93+ * {@inheritDoc}
94+ */
95+ public function isListener ($ name )
96+ {
97+ return isset ($ this ->listeners [$ name ]);
98+ }
99+
80100 /**
81101 * {@inheritDoc}
82102 */
Original file line number Diff line number Diff line change @@ -131,4 +131,23 @@ public function getApiBaseUrl();
131131 * @return $this
132132 */
133133 public function addListener (ListenerInterface $ listener );
134+
135+ /**
136+ * Get listener interface
137+ *
138+ * @param string $name
139+ * @return ListenerInterface
140+ *
141+ * @throws \InvalidArgumentException
142+ */
143+ public function getListener ($ name );
144+
145+ /**
146+ * Check if a listener exists
147+ *
148+ * @access public
149+ * @param string $name
150+ * @return bool
151+ */
152+ public function isListener ($ name );
134153}
You can’t perform that action at this time.
0 commit comments