Skip to content

Commit 887e7e6

Browse files
Merge remote-tracking branch 'mainline/develop' into AC-1445
2 parents 8c6347f + cf2cccf commit 887e7e6

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ReCaptchaWebapiRest/Plugin/RestValidationPlugin.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@ public function __construct(
7171
* Validate ReCaptcha if needed.
7272
*
7373
* @param RequestValidator $subject
74+
* @param callable $proceed
7475
* @throws WebapiException
7576
* @return void
7677
*
7778
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7879
*/
79-
public function afterValidate(RequestValidator $subject): void
80+
public function aroundValidate(RequestValidator $subject, callable $proceed): void
8081
{
81-
$route = $this->restRouter->match($this->request);
82-
/** @var Endpoint $endpoint */
82+
$request = clone $this->request;
83+
$proceed();
84+
$route = $this->restRouter->match($request);
8385
$endpoint = $this->endpointFactory->create([
8486
'class' => $route->getServiceClass(),
8587
'method' => $route->getServiceMethod(),

ReCaptchaWebapiRest/Test/Unit/Plugin/RestValidationPluginTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ public function testPlugin(
120120
$this->expectException(Exception::class);
121121
}
122122

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);
124128
}
125129
}

TwoFactorAuth/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"christian-riesen/base32": "^1.3",
1616
"spomky-labs/otphp": "^10.0",
1717
"endroid/qr-code": "^3.7",
18-
"donatj/phpuseragentparser": "~0.7",
1918
"2tvenom/cborencode": "^1.0"
2019
},
2120
"type": "magento2-module",

0 commit comments

Comments
 (0)