Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 7648131

Browse files
committed
magento-engcom/bulk-api#7 Add extension point to WebAPI
- fixed static errors - fixed sort order of the injected objects
1 parent fd40929 commit 7648131

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

app/code/Magento/Webapi/Controller/Rest/RequestProcessorPool.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public function __construct($requestProcessors = [])
3535
*/
3636
public function getProcessor(\Magento\Framework\Webapi\Rest\Request $request)
3737
{
38-
/**
39-
* @var RequestProcessorInterface $processor
40-
*/
4138
foreach ($this->requestProcessors as $processor) {
4239
if ($processor->canProcess($request)) {
4340
return $processor;

app/code/Magento/Webapi/Controller/Rest/SchemaRequestProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public function getProcessorPath()
7171
/**
7272
* {@inheritdoc}
7373
*/
74-
public function canProcess(\Magento\Framework\Webapi\Rest\Request $request) {
74+
public function canProcess(\Magento\Framework\Webapi\Rest\Request $request)
75+
{
7576
if (strpos(ltrim($request->getPathInfo(), '/'), $this->getProcessorPath()) === 0) {
7677
return true;
7778
}

app/code/Magento/Webapi/Controller/Rest/SynchronousRequestProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ public function getProcessorPath()
118118
/**
119119
* {@inheritdoc}
120120
*/
121-
public function canProcess(\Magento\Framework\Webapi\Rest\Request $request) {
121+
public function canProcess(\Magento\Framework\Webapi\Rest\Request $request)
122+
{
122123
if (strpos(ltrim($request->getPathInfo(), '/'), $this->getProcessorPath()) === 0) {
123124
return true;
124125
}

app/code/Magento/Webapi/etc/webapi_rest/di.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,8 @@
7575
<type name="Magento\Webapi\Controller\Rest\RequestProcessorPool">
7676
<arguments>
7777
<argument name="requestProcessors" xsi:type="array">
78-
<item name="syncSchema" xsi:type="array">
79-
<item name="type" xsi:type="object">Magento\Webapi\Controller\Rest\SchemaRequestProcessor</item>
80-
<item name="sortOrder" xsi:type="string">50</item>
81-
</item>
82-
<item name="sync" xsi:type="array">
83-
<item name="type" xsi:type="object">Magento\Webapi\Controller\Rest\SynchronousRequestProcessor</item>
84-
<item name="sortOrder" xsi:type="string">100</item>
85-
</item>
78+
<item name="syncSchema" xsi:type="object" sortOrder="50">Magento\Webapi\Controller\Rest\SchemaRequestProcessor</item>
79+
<item name="sync" xsi:type="object" sortOrder="100">Magento\Webapi\Controller\Rest\SynchronousRequestProcessor</item>
8680
</argument>
8781
</arguments>
8882
</type>

0 commit comments

Comments
 (0)