File tree Expand file tree Collapse file tree 5 files changed +29
-14
lines changed
Expand file tree Collapse file tree 5 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ protected function get_strict_mode_message()
6262 }
6363}
6464
65- class Action_Responder
65+ class Action_Responder extends Responder
6666{
6767 /**
6868 * @var mixed
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ public function apply($args)
4949 return call_user_func_array (array ($ processors , 'send ' ), $ args );
5050 }
5151
52+ /**
53+ * @return Filter_Responder
54+ */
5255 protected function new_responder ()
5356 {
5457 return new Filter_Responder ();
@@ -63,7 +66,7 @@ protected function get_strict_mode_message()
6366 }
6467
6568 /**
66- * @return Filter_Responder
69+ * @return Action_Responder| Filter_Responder|HookedCallbackResponder
6770 */
6871 public function withAnything ()
6972 {
@@ -74,18 +77,8 @@ public function withAnything()
7477 }
7578}
7679
77- class Filter_Responder
80+ class Filter_Responder extends Responder
7881{
79- /**
80- * @var mixed
81- */
82- protected $ value ;
83-
84- public function reply ($ value )
85- {
86- $ this ->value = $ value ;
87- }
88-
8982 public function send ()
9083 {
9184 if ($ this ->value instanceof InvokedFilterValue) {
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ protected function get_strict_mode_message()
9696 }
9797}
9898
99- class HookedCallbackResponder
99+ class HookedCallbackResponder extends Responder
100100{
101101 /**
102102 * @var callable
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace WP_Mock ;
4+
5+ abstract class Responder
6+ {
7+ /**
8+ * @var mixed
9+ */
10+ protected $ value ;
11+
12+ /**
13+ * @param mixed $value
14+ * @return void
15+ */
16+ public function reply ($ value )
17+ {
18+ $ this ->value = $ value ;
19+ }
20+ }
Original file line number Diff line number Diff line change @@ -320,6 +320,7 @@ public function testCanGetDeprecatedMethodListener(): void
320320 * @preserveGlobalState disabled
321321 *
322322 * @return void
323+ * @throws Exception|InvalidArgumentException
323324 */
324325 public function testOnFilterPasses (): void
325326 {
@@ -343,6 +344,7 @@ public function testOnFilterPasses(): void
343344 * @preserveGlobalState disabled
344345 *
345346 * @return void
347+ * @throws Exception|InvalidArgumentException
346348 */
347349 public function testOnFilterPassesWithAnything (): void
348350 {
You can’t perform that action at this time.
0 commit comments