Completed
Push — master ( f45e90...50f395 )
by Jan-Petter
05:20
created

ErrorHandlerTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
c 1
b 1
f 0
lcom 1
cbo 0
dl 0
loc 23
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A errorHandlerCallback() 0 5 1
1
<?php
2
/**
3
 * vipnytt/RobotsTxtParser
4
 *
5
 * @link https://github.com/VIPnytt/RobotsTxtParser
6
 * @license https://github.com/VIPnytt/RobotsTxtParser/blob/master/LICENSE The MIT License (MIT)
7
 */
8
9
namespace vipnytt\RobotsTxtParser\Handler;
10
11
/**
12
 * Class ErrorHandlerTrait
13
 *
14
 * @package vipnytt\RobotsTxtParser\Handler
15
 */
16
trait ErrorHandlerTrait
17
{
18
    /**
19
     * Error log
20
     * @var string[]
21
     */
22
    protected $errorLog = [];
23
24
    /**
25
     * Custom error handler
26
     *
27
     * @param int $errNo
28
     * @param string $errStr
29
     * @param string $errFile
30
     * @param string $errLine
31
     * @return bool
32
     */
33
    protected function errorHandlerCallback($errNo, $errStr, $errFile, $errLine)
34
    {
35
        $this->errorLog[(string)microtime(true)] = "lvl: " . $errNo . " | msg:" . $errStr . " | file:" . $errFile . " | ln:" . $errLine;
36
        return true;
37
    }
38
}
39