Skip to content

Commit

Permalink
[FIX] - fixed php_cs in code
Browse files Browse the repository at this point in the history
  • Loading branch information
rakibabu committed Aug 9, 2018
1 parent 0f9d6c4 commit d019dfc
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 41 deletions.
9 changes: 4 additions & 5 deletions Controller/Adminhtml/Test/Sentry.php
Expand Up @@ -2,12 +2,12 @@

namespace JustBetter\Sentry\Controller\Adminhtml\Test;

use Psr\Log\LoggerInterface;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\Filesystem\DirectoryList;
use Magento\Framework\Json\Helper\Data;
use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Psr\Log\LoggerInterface;
use Magento\Framework\Filesystem\DirectoryList;

/**
* Class Sentry
Expand Down Expand Up @@ -58,8 +58,7 @@ public function __construct(
Data $jsonHelper,
LoggerInterface $logger,
DirectoryList $directoryList
)
{
) {
$this->resultPageFactory = $resultPageFactory;
$this->jsonHelper = $jsonHelper;
$this->logger = $logger;
Expand Down
27 changes: 14 additions & 13 deletions Helper/Data.php
@@ -1,21 +1,20 @@
<?php

namespace JustBetter\Sentry\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\State;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;

/**
* Class Data
*
* @package JustBetter\Sentry\Helper
*/

namespace Helper;

use Magento\Framework\App\State;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\App\Helper\AbstractHelper;

class Data extends AbstractHelper
{

const XML_PATH_SRS = 'sentry/general/';

/**
Expand Down Expand Up @@ -54,10 +53,10 @@ public function __construct(
Context $context,
StoreManagerInterface $storeManager,
State $appState
)
{
) {
$this->storeManager = $storeManager;
$this->appState = $appState;

parent::__construct($context);
}

Expand All @@ -69,7 +68,9 @@ public function __construct(
public function getConfigValue($field, $storeId = null)
{
return $this->scopeConfig->getValue(
$field, ScopeInterface::SCOPE_STORE, $storeId
$field,
ScopeInterface::SCOPE_STORE,
$storeId
);
}

Expand Down Expand Up @@ -100,7 +101,7 @@ public function collectModuleConfig()
*/
public function isActive()
{
return ( ! empty($this->config) && array_key_exists('enabled', $this->config) && $this->config['enabled']);
return (! empty($this->config) && array_key_exists('enabled', $this->config) && $this->config['enabled']);
}

/**
Expand Down
14 changes: 6 additions & 8 deletions Model/SentryLog.php
Expand Up @@ -2,13 +2,13 @@

namespace JustBetter\Sentry\Model;

use Magento\Framework\Logger\Monolog;
use Magento\Customer\Model\Session;
use Raven_Client;
use Monolog\Logger;
use Monolog\Handler\RavenHandler;
use JustBetter\Sentry\Helper\Data;
use Magento\Customer\Model\Session;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RavenHandler;
use Monolog\Logger;
use Raven_Client;
use Magento\Framework\Logger\Monolog;

class SentryLog extends Monolog
{
Expand Down Expand Up @@ -42,8 +42,7 @@ public function __construct(
array $processors = [],
Data\Proxy $data,
Session\Proxy $customerSession
)
{
) {
$this->data = $data;
$this->customerSession = $customerSession;
parent::__construct($name, $handlers, $processors);
Expand Down Expand Up @@ -78,7 +77,6 @@ protected function sendRecordToSentry($message, $logLevel)
$this->config = $this->data->collectModuleConfig();

if ($this->data->isActive() && $logLevel >= (int) $this->config['log_level']) {

$client = (new Raven_Client(
$this->config['domain'] ?? null
));
Expand Down
20 changes: 9 additions & 11 deletions Plugin/ExceptionCatcher.php
Expand Up @@ -2,16 +2,16 @@

namespace JustBetter\Sentry\Plugin;

use JustBetter\Sentry\Model\SentryLog;
use Magento\Customer\Model\Session;
use Raven_Client;
use Monolog\Logger;
use Magento\Framework\App\Http;
use Magento\Framework\App\Bootstrap;
use JustBetter\Sentry\Helper\Data;
use Magento\Framework\App\State;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\RavenHandler;
use Monolog\Logger;
use Raven_Client;
use JustBetter\Sentry\Helper\Data;
use Magento\Customer\Model\Session;
use Monolog\Formatter\LineFormatter;
use Magento\Framework\App\Bootstrap;
use JustBetter\Sentry\Model\SentryLog;

class ExceptionCatcher
{
Expand Down Expand Up @@ -64,8 +64,7 @@ public function __construct(
Session $catalogSession,
State $state,
SentryLog $logger
)
{
) {
$this->data = $data;
$this->state = $state;
$this->logger = $logger;
Expand All @@ -84,8 +83,7 @@ public function beforeCatchException(
Http $subject,
Bootstrap $bootstrap,
\Exception $exception
)
{
) {
$this->config = $this->data->collectModuleConfig();

if ($this->data->isActive() && ($this->data->isProductionMode() || $this->data->isOverwriteProductionMode())) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": ">=7.0",
"sentry/sentry": "^1.8",
"sentry/sentry": "^1.9",
"monolog/monolog": "*",
"magento/framework": "*"
},
Expand Down
6 changes: 3 additions & 3 deletions view/adminhtml/web/js/testsentry.js
@@ -1,9 +1,9 @@
define([
"jquery",
"Magento_Ui/js/modal/alert",
"mage/translate",
"jquery/ui"
], function ($, alert, $t, validation) {
"mage/translate",
"Magento_Ui/js/modal/alert",
], function ($, validation, $t, alert) {
"use strict";

$.widget('justbetter.testSentry', {
Expand Down

0 comments on commit d019dfc

Please sign in to comment.