Completed
Push — master ( f172d4...76e139 )
by devosc
02:14
created

src/Exception/Exception.php (5 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 *
4
 */
5
6
namespace Mvc5\Exception;
7
8
trait Exception
9
{
10
    /**
11
     *
12
     */
13
    use Base;
14
15
    /**
16
     * @param string $message
17
     * @param int $code
18
     * @param int $severity
19
     * @param string $file
20
     * @param int $line
21
     * @param \Throwable|null $previous
22
     * @param int $offset
23
     * @return mixed
24
     * @throws \ErrorException
25
     */
26 3
    static function errorException(
0 ignored issues
show
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...
27
        $message = '', $code = 0, $severity = E_ERROR, $file = __FILE__, $line = __LINE__, \Throwable $previous = null, $offset = 2
28
    ) {
29 3
        return static::raise(static::offset(
30 3
            static::instance(static::ERROR_EXCEPTION, [$message, $code, $severity, $file, $line, $previous]), $offset
31
        ));
32
    }
33
34
    /**
35
     * @param string $message
36
     * @param int $code
37
     * @param \Throwable|null $previous
38
     * @param int $offset
39
     * @return mixed
40
     * @throws \Exception
41
     */
42 3
    static function exception($message = '', $code = 0, \Throwable $previous = null, $offset = 2)
0 ignored issues
show
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...
Using PHP4-style constructors that are named like the class is not recommend; better use the more explicit __construct method.
Loading history...
43
    {
44 3
        return static::raise(static::create(static::EXCEPTION, [$message, $code, $previous], $offset));
45
    }
46
47
    /**
48
     * @param string $message
49
     * @param int $code
50
     * @param \Throwable|null $previous
51
     * @param int $offset
52
     * @return mixed
53
     * @throws \InvalidArgumentException
54
     */
55 5
    static function invalidArgument($message = '', $code = 0, \Throwable $previous = null, $offset = 2)
0 ignored issues
show
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...
56
    {
57 5
        return static::raise(static::create(static::INVALID_ARGUMENT, [$message, $code, $previous], $offset));
58
    }
59
60
    /**
61
     * @param string $message
62
     * @param int $code
63
     * @param \Throwable|null $previous
64
     * @param int $offset
65
     * @return mixed
66
     * @throws \RuntimeException
67
     */
68 16
    static function runtime($message = '', $code = 0, \Throwable $previous = null, $offset = 2)
0 ignored issues
show
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...
69
    {
70 16
        return static::raise(static::create(static::RUNTIME, [$message, $code, $previous], $offset));
71
    }
72
}
73