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

Commit 046765c

Browse files
committed
[TASK] Updated based on code standards
1 parent 813dca5 commit 046765c

File tree

2 files changed

+48
-40
lines changed

2 files changed

+48
-40
lines changed
Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
1-
<?php
2-
/***
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
5-
*/
6-
namespace Magento\Swagger\Helper;
7-
8-
/**
9-
* Class Data
10-
* @package Magento\Swagger\Helper\Data
11-
*/
12-
class Data extends \Magento\Framework\App\Helper\AbstractHelper
13-
{
14-
15-
/**
16-
* @var \Magento\Framework\App\Request\Http
17-
*/
18-
protected $request;
19-
20-
/**
21-
* @param \Magento\Framework\App\Helper\Context $context
22-
* @param \Magento\Framework\App\Request\Http $request
23-
*/
24-
public function __construct(
25-
\Magento\Framework\App\Helper\Context $context,
26-
\Magento\Framework\App\Request\Http $request
27-
) {
28-
$this->request = $request;
29-
parent::__construct($context);
30-
}
31-
32-
/**
33-
* @return mixed|string
34-
*/
35-
public function getParamStore()
36-
{
37-
return ($this->request->getParam('store')) ? $this->request->getParam('store') : 'all';
38-
}
39-
}
1+
<?php
2+
/***
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Swagger\Helper;
7+
8+
/**
9+
* Class Data
10+
* @package Magento\Swagger\Helper\Data
11+
*/
12+
class Data extends \Magento\Framework\App\Helper\AbstractHelper
13+
{
14+
15+
/**
16+
* @var \Magento\Framework\App\Request\Http
17+
*/
18+
protected $request;
19+
20+
/**
21+
* @param \Magento\Framework\App\Helper\Context $context
22+
* @param \Magento\Framework\App\Request\Http $request
23+
*/
24+
public function __construct(
25+
\Magento\Framework\App\Helper\Context $context,
26+
\Magento\Framework\App\Request\Http $request
27+
) {
28+
$this->request = $request;
29+
parent::__construct($context);
30+
}
31+
32+
/**
33+
* @return mixed|string
34+
*/
35+
public function getParamStore()
36+
{
37+
return ($this->request->getParam('store')) ? $this->request->getParam('store') : 'all';
38+
}
39+
40+
/**
41+
* @return string
42+
*/
43+
public function getSchemaUrl()
44+
{
45+
return rtrim($this->getBaseUrl(), '/') . '/rest/' . $this->getParamStore() . '/schema?services=all';
46+
}
47+
}

app/code/Magento/Swagger/view/frontend/templates/swagger-ui/index.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/** @var \Magento\Framework\View\Element\Template $block */
1616

17-
$schemaUrl = rtrim($block->getBaseUrl(), '/') . '/rest/' . $this->helper('Magento\Swagger\Helper\Data')->getParamStore() . '/schema?services=all';
17+
$schemaUrl = $block->getSchemaUrl();
1818
?>
1919

2020
<div id='header'>

0 commit comments

Comments
 (0)