LogHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A log() 0 8 2
A cleanLog() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Lai Vu
5
 * Date: 10/25/2016
6
 * Time: 9:16 AM
7
 */
8
9
namespace LaiVu\ActivityLog\Handlers;
10
11
12
use Log;
13
14
class LogHandler implements ActivityLogHandlerInterface
15
{
16
17
    /**
18
     * @param \Illuminate\Database\Eloquent\Model $performOn
19
     * @param \Illuminate\Database\Eloquent\Model $causerBy
20
     * @param array $properties
21
     * @param $logName
22
     * @param string $description
23
     * @return mixed
24
     */
25
    function log($performOn, $causerBy, $properties = [], $logName, $description)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
26
    {
27
        $logText = "[Activity] [$logName] ";
28
        $userId = isset($causerBy) ? $causerBy->id : 'not set';
29
        $logText .= "[$userId] - $description";
30
        Log::info($logText);
31
        return true;
32
    }
33
34
    /**
35
     * @param $maxAgeInMonth
36
     * @return boolean
37
     */
38
    function cleanLog($maxAgeInMonth)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
39
    {
40
        // TODO: Implement cleanLog() method.
41
    }
42
}