Skip to content

Commit d81e1b9

Browse files
committed
Fixing issue splashlab#6 where the Phrase object was used withont importing, instead of just using the __() global translate function.
1 parent b284d98 commit d81e1b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Plugin/CorsRequestOptionsPlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace SplashLab\CorsRequests\Plugin;
88

99
use Magento\Framework\Webapi\Request;
10+
use Magento\Framework\Exception\InputException;
1011

1112
/**
1213
* Class CorsRequestOptionsPlugin
@@ -22,13 +23,13 @@ class CorsRequestOptionsPlugin
2223
*
2324
* @param Request $subject
2425
* @return void
25-
* @throws \Magento\Framework\Exception\InputException
26+
* @throws InputException
2627
*/
2728
public function aroundGetHttpMethod(
2829
Request $subject
2930
) {
3031
if (!$subject->isGet() && !$subject->isPost() && !$subject->isPut() && !$subject->isDelete() && !$subject->isOptions()) {
31-
throw new \Magento\Framework\Exception\InputException(new Phrase('Request method is invalid.'));
32+
throw new InputException(__('Request method is invalid.'));
3233
}
3334
return $subject->getMethod();
3435
}

0 commit comments

Comments
 (0)