File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -71,15 +71,17 @@ public function __construct(
71
71
* Validate ReCaptcha if needed.
72
72
*
73
73
* @param RequestValidator $subject
74
+ * @param callable $proceed
74
75
* @throws WebapiException
75
76
* @return void
76
77
*
77
78
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
78
79
*/
79
- public function afterValidate (RequestValidator $ subject ): void
80
+ public function aroundValidate (RequestValidator $ subject, callable $ proceed ): void
80
81
{
81
- $ route = $ this ->restRouter ->match ($ this ->request );
82
- /** @var Endpoint $endpoint */
82
+ $ request = clone $ this ->request ;
83
+ $ proceed ();
84
+ $ route = $ this ->restRouter ->match ($ request );
83
85
$ endpoint = $ this ->endpointFactory ->create ([
84
86
'class ' => $ route ->getServiceClass (),
85
87
'method ' => $ route ->getServiceMethod (),
Original file line number Diff line number Diff line change @@ -120,6 +120,10 @@ public function testPlugin(
120
120
$ this ->expectException (Exception::class);
121
121
}
122
122
123
- $ this ->model ->afterValidate ($ this ->subject );
123
+ $ proceed = function () : void {
124
+ //dummy function for callable argument
125
+ };
126
+
127
+ $ this ->model ->aroundValidate ($ this ->subject , $ proceed );
124
128
}
125
129
}
Original file line number Diff line number Diff line change 15
15
"christian-riesen/base32" : " ^1.3" ,
16
16
"spomky-labs/otphp" : " ^10.0" ,
17
17
"endroid/qr-code" : " ^3.7" ,
18
- "donatj/phpuseragentparser" : " ~0.7" ,
19
18
"2tvenom/cborencode" : " ^1.0"
20
19
},
21
20
"type" : " magento2-module" ,
You can’t perform that action at this time.
0 commit comments