LoggerNotification   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 25
wmc 2
lcom 0
cbo 3
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A send() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Jenner
5
 * Date: 2015/10/14
6
 * Time: 14:47
7
 */
8
9
namespace Jenner\LogMonitor\Notification;
10
11
12
use Monolog\Handler\StreamHandler;
13
use Monolog\Logger;
14
use Psr\Log\LoggerInterface;
15
16
class LoggerNotification implements NotificationInterface
17
{
18
    /**
19
     * @var LoggerInterface
20
     */
21
    protected $logger;
22
23
    public function __construct()
24
    {
25
        $this->logger = new Logger("logger notification");
26
        $this->logger->pushHandler(new StreamHandler("/tmp/notification.log"));
27
    }
28
29
    /**
30
     * send message to members
31
     * @param array $config
32
     * @param $message
33
     * @return mixed
34
     */
35
    public function send($config, $message)
36
    {
37
        $message = 'config:' . json_encode($config) . PHP_EOL . 'message:' . $message . PHP_EOL;
38
        $this->logger->info($message);
39
    }
40
}