Skip to content

Commit

Permalink
place config facade call with its helper counterpart
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Apr 14, 2021
1 parent 3e8a70b commit 06ae0b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions Tasks/QueryDebuggerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use App\Ship\Parents\Tasks\Task;
use DateTimeInterface;
use DB;
use Illuminate\Support\Facades\Config;
use Log;

class QueryDebuggerTask extends Task
Expand All @@ -16,11 +15,11 @@ class QueryDebuggerTask extends Task
*/
public function run(): void
{
$debuggerEnabled = Config::get('debugger.queries.debug');
$debuggerEnabled = config('debugger.queries.debug');

if ($debuggerEnabled) {
$consoleOutputEnabled = Config::get('debugger.queries.output.console');
$logOutputEnabled = Config::get('debugger.queries.output.log');
$consoleOutputEnabled = config('debugger.queries.output.console');
$logOutputEnabled = config('debugger.queries.output.log');

DB::listen(function ($event) use ($consoleOutputEnabled, $logOutputEnabled) {
$bindings = $event->bindings;
Expand Down
5 changes: 2 additions & 3 deletions Values/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Containers\VendorSection\Debugger\Values;

use App\Ship\Parents\Values\Value;
use Illuminate\Support\Facades\Config;
use Jenssegers\Agent\Facades\Agent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -21,8 +20,8 @@ public function __construct(Request $request, Response $response)
$this->request = $request;
$this->response = $response;

$this->responseDataCut = Config::get("debugger.requests.response_show_first");
$this->tokenDataCut = Config::get("debugger.requests.token_show_first");
$this->responseDataCut = config("debugger.requests.response_show_first");
$this->tokenDataCut = config("debugger.requests.token_show_first");
}

public function get(): string
Expand Down
5 changes: 2 additions & 3 deletions Values/RequestsLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use App\Ship\Parents\Values\Value;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Config;
use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
Expand All @@ -27,8 +26,8 @@ public function __construct()
private function prepareConfigs(): void
{
$this->environment = App::environment();
$this->debuggingEnabled = Config::get("debugger.requests.debug");
$this->logFile = Config::get("debugger.requests.log_file");
$this->debuggingEnabled = config("debugger.requests.debug");
$this->logFile = config("debugger.requests.log_file");
}

private function prepareLogger(): void
Expand Down

0 comments on commit 06ae0b8

Please sign in to comment.