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

ErrorHandlerTrait::errorHandlerCallback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 4
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