eisen-dev/eisen_front

View on GitHub
webd/includes/monologLogger.php

Summary

Maintainability
A
0 mins
Test Coverage
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 22 and the first side effect is on line 12.
<?php
/**
* Eisen Frontend
* http://eisen-dev.github.io
*
* Copyright (c) 2016 Alice Ferrazzi <alice.ferrazzi@gmail.com> - Takuma Muramatsu <t.muramatu59@gmail.com>
* Dual licensed under the MIT or GPL Version 3 licenses or later.
* http://eisen-dev.github.io/License.md
*
*/
 
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/monologDB.php';
use Monolog\Handler\SlackHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\BrowserConsoleHandler;
use Monolog\Logger;
 
/**
* Class loggerStart
*/
Each class must be in a namespace of at least one level (a top-level vendor name)
Line indented incorrectly; expected 0 spaces, found 1
class LoggerAtOnce
{
/**
* @return Logger
*/
public function loggerInject()
{
Missing class import via use statement (line '29', column '20').
$dba = new DbAction();
$dbh = $dba->Connect();
$config = (parse_ini_file(realpath("../config.ini")));
$log = new Logger('name');
// create a log channel
Missing class import via use statement (line '34', column '31').
$log->pushHandler(new PDOHandler($dbh));
if (isset($config['token'])) {
$log->pushHandler(new SlackHandler(
$config['token'],
$config['channel'],
$config['botname'],
true,
null,
Logger::INFO
));
}
$log->pushHandler(new BrowserConsoleHandler(\Monolog\Logger::INFO));
$log->pushHandler(new StreamHandler('php://stderr', \Monolog\Logger::ERROR));
return $log;
}
Closing brace indented incorrectly; expected 1 spaces, found 0
}