ErrorHandlerInterface::log()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
1
<?php
2
3
namespace Jasny;
4
5
/**
6
 * Interface for interacting with an error handler.
7
 * The interface is not concerned with how the error handler is configured.
8
 */
9
interface ErrorHandlerInterface
10
{
11
    /**
12
     * Set the caught error.
13
     * 
14
     * @param \Throwable|\Exception|\Error
15
     */
16
    public function setError($error);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
17
    
18
    /**
19
     * Get the caught error.
20
     * 
21
     * @return \Throwable|\Exception|\Error
22
     */
23
    public function getError();
24
25
    /**
26
     * Log an error or exception
27
     * 
28
     * @param \Exception|\Error $error
29
     */
30
    public function log($error);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
31
}
32