@@ -64,7 +64,7 @@ class Module
6464 /**
6565 * @param MvcEvent $event
6666 */
67- public function onBootstrap (MvcEvent $ event )
67+ public function onBootstrap (MvcEvent $ event ): void
6868 {
6969 // Setup RavenClient (provided by Sentry) and Sentry (provided by this module)
7070 $ this ->config = $ event ->getApplication ()->getServiceManager ()->get ('Config ' );
@@ -73,7 +73,7 @@ public function onBootstrap(MvcEvent $event)
7373 return ;
7474 }
7575
76- if (isset ($ this ->config ['zend-sentry ' ]['raven-config ' ]) && is_array ($ this ->config ['zend-sentry ' ]['raven-config ' ])) {
76+ if (isset ($ this ->config ['zend-sentry ' ]['raven-config ' ]) && \ is_array ($ this ->config ['zend-sentry ' ]['raven-config ' ])) {
7777 $ ravenConfig = $ this ->config ['zend-sentry ' ]['raven-config ' ];
7878 } else {
7979 $ ravenConfig = [];
@@ -103,7 +103,7 @@ public function onBootstrap(MvcEvent $event)
103103
104104 // If ZendSentry is configured to log errors, register it as error handler
105105 if ($ this ->config ['zend-sentry ' ]['handle-errors ' ]) {
106- $ errorReportingLevel = ( isset ( $ this ->config ['zend-sentry ' ]['error-reporting ' ])) ? $ this -> config [ ' zend-sentry ' ][ ' error-reporting ' ] : -1 ;
106+ $ errorReportingLevel = $ this ->config ['zend-sentry ' ]['error-reporting ' ] ?? -1 ;
107107 $ this ->zendSentry ->registerErrorHandler ($ this ->config ['zend-sentry ' ]['call-existing-error-handler ' ], $ errorReportingLevel );
108108 }
109109
@@ -121,7 +121,7 @@ public function onBootstrap(MvcEvent $event)
121121 /**
122122 * @return array
123123 */
124- public function getAutoloaderConfig ()
124+ public function getAutoloaderConfig (): array
125125 {
126126 return [
127127 'Zend\Loader\StandardAutoloader ' => [
@@ -147,7 +147,7 @@ public function getConfig()
147147 *
148148 * @param MvcEvent $event
149149 */
150- protected function setupBasicLogging (MvcEvent $ event )
150+ protected function setupBasicLogging (MvcEvent $ event ): void
151151 {
152152 // Get the shared event manager and attach a logging listener for the log event on application level
153153 $ sharedManager = $ this ->eventManager ->getSharedManager ();
@@ -156,8 +156,8 @@ protected function setupBasicLogging(MvcEvent $event)
156156
157157 $ sharedManager ->attach ('* ' , 'log ' , function ($ event ) use ($ raven , $ logLevels ) {
158158 /** @var $event MvcEvent */
159- if (is_object ($ event ->getTarget ())) {
160- $ target = get_class ($ event ->getTarget ());
159+ if (\ is_object ($ event ->getTarget ())) {
160+ $ target = \ get_class ($ event ->getTarget ());
161161 } else {
162162 $ target = (string ) $ event ->getTarget ();
163163 }
@@ -178,7 +178,7 @@ protected function setupBasicLogging(MvcEvent $event)
178178 *
179179 * @param MvcEvent $event
180180 */
181- protected function setupExceptionLogging (MvcEvent $ event )
181+ protected function setupExceptionLogging (MvcEvent $ event ): void
182182 {
183183 // Register Sentry as exception handler for exception that bubble up to the top
184184 $ this ->zendSentry ->registerExceptionHandler ($ this ->config ['zend-sentry ' ]['call-existing-exception-handler ' ]);
@@ -191,7 +191,7 @@ protected function setupExceptionLogging(MvcEvent $event)
191191 }
192192
193193 // Check if script is running in console
194- $ exceptionStrategy = (PHP_SAPI == 'cli ' ) ? ( new SentryConsoleStrategy ()) : ( new SentryHttpStrategy () );
194+ $ exceptionStrategy = (PHP_SAPI == 'cli ' ) ? new SentryConsoleStrategy () : new SentryHttpStrategy ();
195195 $ exceptionStrategy ->attach ($ this ->eventManager );
196196 $ exceptionStrategy ->setDisplayExceptions ($ this ->config ['zend-sentry ' ]['display-exceptions ' ]);
197197 $ exceptionStrategy ->setDefaultExceptionMessage ($ this ->config ['zend-sentry ' ][(PHP_SAPI == 'cli ' ) ? 'default-exception-console-message ' : 'default-exception-message ' ]);
@@ -214,7 +214,7 @@ protected function setupExceptionLogging(MvcEvent $event)
214214 *
215215 * @param MvcEvent $event
216216 */
217- protected function setupJavascriptLogging (MvcEvent $ event )
217+ protected function setupJavascriptLogging (MvcEvent $ event ): void
218218 {
219219 $ viewHelper = $ event ->getApplication ()->getServiceManager ()->get ('ViewHelperManager ' )->get ('headscript ' );
220220 $ useRavenjsCDN = $ this ->config ['zend-sentry ' ]['use-ravenjs-cdn ' ];
@@ -232,7 +232,7 @@ protected function setupJavascriptLogging(MvcEvent $event)
232232 * @param string $key
233233 * @return string $publicKey
234234 */
235- private function convertKeyToPublic ($ key )
235+ private function convertKeyToPublic ($ key ): string
236236 {
237237 // If new DSN is configured, no converting is needed
238238 if (substr_count ($ key , ': ' ) == 1 ) {
0 commit comments