Skip to content

Commit 4510cf6

Browse files
royduinStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent 6133cd5 commit 4510cf6

15 files changed

+94
-73
lines changed

Block/Adminhtml/System/Config/Button.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ class Button extends Field
1313
protected $_template = 'system/config/button.phtml';
1414

1515
/**
16-
* Unset scope
16+
* Unset scope.
1717
*
1818
* @param AbstractElement $element
19+
*
1920
* @return string
2021
*/
2122
public function render(AbstractElement $element)
@@ -26,9 +27,10 @@ public function render(AbstractElement $element)
2627
}
2728

2829
/**
29-
* Get the button and scripts contents
30+
* Get the button and scripts contents.
3031
*
3132
* @param \Magento\Framework\Data\Form\Element\AbstractElement $element
33+
*
3234
* @return string
3335
*/
3436
protected function _getElementHtml(AbstractElement $element)

Block/Adminhtml/System/Config/DeploymentConfigInfo.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace JustBetter\Sentry\Block\Adminhtml\System\Config;
44

5-
use Magento\Config\Block\System\Config\Form\Field;
6-
use Magento\Framework\Data\Form\Element\AbstractElement;
75
use JustBetter\Sentry\Helper\Version;
86
use Magento\Backend\Block\Template\Context;
7+
use Magento\Config\Block\System\Config\Form\Field;
8+
use Magento\Framework\Data\Form\Element\AbstractElement;
99

1010
class DeploymentConfigInfo extends Field
1111
{
@@ -21,8 +21,9 @@ class DeploymentConfigInfo extends Field
2121

2222
/**
2323
* DeploymentConfigInfo constructor.
24+
*
2425
* @param Context $context
25-
* @param array $data
26+
* @param array $data
2627
* @param Version $version
2728
*/
2829
public function __construct(
@@ -40,7 +41,8 @@ public function render(AbstractElement $element)
4041
}
4142

4243
/**
43-
* Get static version
44+
* Get static version.
45+
*
4446
* @return string
4547
*/
4648
public function getVersion()

Block/SentryScript.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ class SentryScript extends Template
99
{
1010
/**
1111
* SentryScript constructor.
12-
* @param DataHelper $dataHelper
12+
*
13+
* @param DataHelper $dataHelper
1314
* @param Template\Context $context
14-
* @param array $data
15+
* @param array $data
1516
*/
1617
public function __construct(
1718
DataHelper $dataHelper,
@@ -27,6 +28,7 @@ public function __construct(
2728
* Show script tag depending on blockName.
2829
*
2930
* @param string $blockName
31+
*
3032
* @return bool
3133
*/
3234
public function canUseScriptTag($blockName)

Controller/Adminhtml/Test/Sentry.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
use JustBetter\Sentry\Helper\Data;
66
use JustBetter\Sentry\Model\SentryLog;
77
use JustBetter\Sentry\Plugin\MonologPlugin;
8-
use Magento\Framework\Serialize\Serializer\Json;
9-
use Psr\Log\LoggerInterface;
108
use Magento\Backend\App\Action;
119
use Magento\Backend\App\Action\Context;
10+
use Magento\Framework\Serialize\Serializer\Json;
1211
use Magento\Framework\View\Result\PageFactory;
12+
use Psr\Log\LoggerInterface;
1313

1414
class Sentry extends Action
1515
{
1616
/**
17-
* Authorization level of a basic admin session
17+
* Authorization level of a basic admin session.
1818
*
1919
* @see _isAllowed()
2020
*/
@@ -51,12 +51,12 @@ class Sentry extends Action
5151
/**
5252
* Sentry constructor.
5353
*
54-
* @param Context $context
55-
* @param PageFactory $resultPageFactory
56-
* @param Json $jsonSerializer
54+
* @param Context $context
55+
* @param PageFactory $resultPageFactory
56+
* @param Json $jsonSerializer
5757
* @param LoggerInterface $logger
58-
* @param Data $helperSentry
59-
* @param MonologPlugin $monologPlugin
58+
* @param Data $helperSentry
59+
* @param MonologPlugin $monologPlugin
6060
*/
6161
public function __construct(
6262
Context $context,
@@ -67,16 +67,16 @@ public function __construct(
6767
MonologPlugin $monologPlugin
6868
) {
6969
$this->resultPageFactory = $resultPageFactory;
70-
$this->jsonSerializer = $jsonSerializer;
71-
$this->logger = $logger;
72-
$this->helperSentry = $helperSentry;
73-
$this->monologPlugin = $monologPlugin;
70+
$this->jsonSerializer = $jsonSerializer;
71+
$this->logger = $logger;
72+
$this->helperSentry = $helperSentry;
73+
$this->monologPlugin = $monologPlugin;
7474

7575
parent::__construct($context);
7676
}
7777

7878
/**
79-
* Execute view action
79+
* Execute view action.
8080
*
8181
* @return \Magento\Framework\Controller\ResultInterface
8282
*/
@@ -87,7 +87,7 @@ public function execute()
8787
if ($this->helperSentry->isActive()) {
8888
try {
8989
$this->monologPlugin->addAlert('TEST message from Magento 2', []);
90-
$result['status'] = true;
90+
$result['status'] = true;
9191
$result['content'] = __('Check sentry.io which should hold an alert');
9292
} catch (\Exception $e) {
9393
$result['content'] = $e->getMessage();

Helper/Data.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
namespace JustBetter\Sentry\Helper;
44

55
use Magento\Framework\App\Area;
6+
use Magento\Framework\App\DeploymentConfig;
7+
use Magento\Framework\App\Helper\AbstractHelper;
8+
use Magento\Framework\App\Helper\Context;
9+
use Magento\Framework\App\ProductMetadataInterface;
610
use Magento\Framework\App\State;
711
use Magento\Store\Model\ScopeInterface;
8-
use Magento\Framework\App\Helper\Context;
912
use Magento\Store\Model\StoreManagerInterface;
10-
use Magento\Framework\App\Helper\AbstractHelper;
11-
use Magento\Framework\Exception\LocalizedException;
12-
use Magento\Framework\App\ProductMetadataInterface;
13-
use Magento\Framework\App\DeploymentConfig;
1413

1514
class Data extends AbstractHelper
1615
{
@@ -84,6 +83,7 @@ public function getEnvironment()
8483
/**
8584
* @param $field
8685
* @param null $storeId
86+
*
8787
* @return mixed
8888
*/
8989
public function getConfigValue($field, $storeId = null)
@@ -98,11 +98,12 @@ public function getConfigValue($field, $storeId = null)
9898
/**
9999
* @param $code
100100
* @param null $storeId
101+
*
101102
* @return mixed
102103
*/
103104
public function getGeneralConfig($code, $storeId = null)
104105
{
105-
return $this->getConfigValue(self::XML_PATH_SRS . $code, $storeId);
106+
return $this->getConfigValue(self::XML_PATH_SRS.$code, $storeId);
106107
}
107108

108109
/**
@@ -113,7 +114,7 @@ public function collectModuleConfig()
113114
$this->config['enabled'] = $this->deploymentConfig->get('sentry') !== null;
114115

115116
foreach ($this->configKeys as $value) {
116-
$this->config[$value] = $this->deploymentConfig->get('sentry/' . $value);
117+
$this->config[$value] = $this->deploymentConfig->get('sentry/'.$value);
117118
}
118119

119120
return $this->config;
@@ -156,7 +157,7 @@ public function isOverwriteProductionMode()
156157
}
157158

158159
/**
159-
* Get the current magento version
160+
* Get the current magento version.
160161
*
161162
* @return string
162163
*/
@@ -166,7 +167,7 @@ public function getMagentoVersion()
166167
}
167168

168169
/**
169-
* Get the current store
170+
* Get the current store.
170171
*/
171172
public function getStore()
172173
{
@@ -178,11 +179,12 @@ public function getStore()
178179
*/
179180
public function useScriptTag()
180181
{
181-
return $this->scopeConfig->isSetFlag(static::XML_PATH_SRS . 'enable_script_tag');
182+
return $this->scopeConfig->isSetFlag(static::XML_PATH_SRS.'enable_script_tag');
182183
}
183184

184185
/**
185186
* @param $blockName
187+
*
186188
* @return bool
187189
*/
188190
public function showScriptTagInThisBlock($blockName)
@@ -192,7 +194,7 @@ public function showScriptTagInThisBlock($blockName)
192194
return false;
193195
}
194196

195-
$name = 'sentry.' . $config;
197+
$name = 'sentry.'.$config;
196198

197199
return $name == $blockName;
198200
}

Helper/Version.php

+17-9
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace JustBetter\Sentry\Helper;
44

55
use Magento\Framework\App\DeploymentConfig;
6+
use Magento\Framework\App\Helper\AbstractHelper;
67
use Magento\Framework\App\ObjectManager;
78
use Magento\Framework\Config\ConfigOptionsListConstants;
89
use Psr\Log\LoggerInterface;
9-
use Magento\Framework\App\Helper\AbstractHelper;
1010

1111
/**
12-
* Deployment version of static files
12+
* Deployment version of static files.
1313
*/
1414
class Version extends AbstractHelper
1515
{
@@ -40,8 +40,8 @@ class Version extends AbstractHelper
4040

4141
/**
4242
* @param \Magento\Framework\App\State $appState
43-
* @param Version\StorageInterface $versionStorage
44-
* @param DeploymentConfig|null $deploymentConfig
43+
* @param Version\StorageInterface $versionStorage
44+
* @param DeploymentConfig|null $deploymentConfig
4545
*/
4646
public function __construct(
4747
\Magento\Framework\App\State $appState,
@@ -54,7 +54,7 @@ public function __construct(
5454
}
5555

5656
/**
57-
* Retrieve deployment version of static files
57+
* Retrieve deployment version of static files.
5858
*
5959
* @return string
6060
*/
@@ -63,12 +63,15 @@ public function getValue()
6363
if (!$this->cachedValue) {
6464
$this->cachedValue = $this->readValue($this->appState->getMode());
6565
}
66+
6667
return $this->cachedValue;
6768
}
6869

6970
/**
70-
* Load or generate deployment version of static files depending on the application mode
71+
* Load or generate deployment version of static files depending on the application mode.
72+
*
7173
* @param string $appMode
74+
*
7275
* @return string
7376
*/
7477
protected function readValue($appMode)
@@ -81,18 +84,21 @@ protected function readValue($appMode)
8184
)
8285
) {
8386
$this->getLogger()->critical('Can not load static content version.');
87+
8488
throw new \UnexpectedValueException(
85-
"Unable to retrieve deployment version of static files from the file system."
89+
'Unable to retrieve deployment version of static files from the file system.'
8690
);
8791
}
8892
$result = $this->generateVersion();
8993
$this->versionStorage->save($result);
9094
}
95+
9196
return $result;
9297
}
9398

9499
/**
95-
* Generate version of static content
100+
* Generate version of static content.
101+
*
96102
* @return int
97103
*/
98104
private function generateVersion()
@@ -101,7 +107,8 @@ private function generateVersion()
101107
}
102108

103109
/**
104-
* Get logger
110+
* Get logger.
111+
*
105112
* @return LoggerInterface
106113
*/
107114
private function getLogger()
@@ -110,6 +117,7 @@ private function getLogger()
110117
$this->logger = \Magento\Framework\App\ObjectManager::getInstance()
111118
->get(LoggerInterface::class);
112119
}
120+
113121
return $this->logger;
114122
}
115123
}

Model/Config/Source/LogLevel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace JustBetter\Sentry\Model\Config\Source;
44

5-
use Monolog\Logger;
65
use Magento\Framework\Option\ArrayInterface;
6+
use Monolog\Logger;
77

88
class LogLevel implements ArrayInterface
99
{

Model/Config/Source/ScriptTagPlacement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace JustBetter\Sentry\Model\Config\Source;
44

5-
use \Magento\Framework\Option\ArrayInterface;
5+
use Magento\Framework\Option\ArrayInterface;
66

77
class ScriptTagPlacement implements ArrayInterface
88
{

Model/ReleaseIdentifier.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace JustBetter\Sentry\Model;
@@ -14,6 +15,7 @@ class ReleaseIdentifier
1415

1516
/**
1617
* ReleaseIdentifier constructor.
18+
*
1719
* @param Version $version
1820
*/
1921
public function __construct(
@@ -23,7 +25,8 @@ public function __construct(
2325
}
2426

2527
/**
26-
* Get release ID from magento internal release number
28+
* Get release ID from magento internal release number.
29+
*
2730
* @return string
2831
*/
2932
public function getReleaseId()

Model/SentryInteraction.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace JustBetter\Sentry\Model;

0 commit comments

Comments
 (0)