1 | <?php |
||
29 | class ExceptionStrategy extends AbstractListenerAggregate |
||
30 | { |
||
31 | /** |
||
32 | * Display exceptions? |
||
33 | * @var bool |
||
34 | */ |
||
35 | protected $displayExceptions = false; |
||
36 | |||
37 | /** |
||
38 | * Default Exception Message |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $defaultExceptionMessage = 'Oh no. Something went wrong, but we have been notified. If you are testing, tell us your eventID: %s'; |
||
42 | |||
43 | /** |
||
44 | * Name of exception template |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $exceptionTemplate = 'error'; |
||
48 | |||
49 | /** |
||
50 | * {@inheritDoc} |
||
51 | */ |
||
52 | public function attach(EventManagerInterface $events, $priority = 1) |
||
57 | |||
58 | /** |
||
59 | * Flag: display exceptions in error pages? |
||
60 | * |
||
61 | * @param bool $displayExceptions |
||
62 | * @return ExceptionStrategy |
||
63 | */ |
||
64 | public function setDisplayExceptions($displayExceptions) |
||
69 | |||
70 | /** |
||
71 | * Should we display exceptions in error pages? |
||
72 | * |
||
73 | * @return bool |
||
74 | */ |
||
75 | public function displayExceptions() |
||
79 | |||
80 | /** |
||
81 | * Set the default exception message |
||
82 | * @param string $defaultExceptionMessage |
||
83 | * @return self |
||
84 | */ |
||
85 | public function setDefaultExceptionMessage($defaultExceptionMessage) |
||
90 | |||
91 | /** |
||
92 | * Set the exception template |
||
93 | * |
||
94 | * @param string $exceptionTemplate |
||
95 | * @return ExceptionStrategy |
||
96 | */ |
||
97 | public function setExceptionTemplate($exceptionTemplate) |
||
102 | |||
103 | /** |
||
104 | * Retrieve the exception template |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getExceptionTemplate() |
||
112 | |||
113 | /** |
||
114 | * Create an exception view model, and set the HTTP status code |
||
115 | * |
||
116 | * @param MvcEvent $e |
||
117 | * @return void |
||
118 | */ |
||
119 | public function prepareExceptionViewModel(MvcEvent $e) |
||
176 | } |
||
1 ignored issue
–
show
|
|||
177 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.