FunctionWrapper::errorReporting()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Jasny\ErrorHandler;
4
5
/**
6
 * Wrapper methods for internal PHP functions
7
 *
8
 * @codeCoverageIgnore
9
 */
10
trait FunctionWrapper
11
{
12
    /**
13
     * Wrapper method for `error_reporting`
14
     * 
15
     * @return int
16
     */
17
    protected function errorReporting()
18
    {
19
        return error_reporting();
20
    }
21
22
    /**
23
     * Wrapper method for `error_get_last`
24
     * 
25
     * @return array|null
26
     */
27
    protected function errorGetLast()
28
    {
29
        return error_get_last();
30
    }
31
    
32
    /**
33
     * Wrapper method for `set_error_handler`
34
     * 
35
     * @param callable $callback
36
     * @param int      $error_types
37
     * @return callable|null
38
     */
39
    protected function setErrorHandler($callback, $error_types = E_ALL)
40
    {
41
        return set_error_handler($callback, $error_types);
42
    }
43
    
44
    /**
45
     * Wrapper method for `set_exception_handler`
46
     * 
47
     * @param callable $callback
48
     * @return callable|null
49
     */
50
    protected function setExceptionHandler($callback)
51
    {
52
        return set_exception_handler($callback);
53
    }
54
    
55
    /**
56
     * Wrapper method for `register_shutdown_function`
57
     * 
58
     * @param callable $callback
59
     */
60
    protected function registerShutdownFunction($callback)
61
    {
62
        register_shutdown_function($callback);
63
    }
64
}
65
66