@@ -50,7 +50,7 @@ public function setAutoExit(bool $autoExit)
5050 $ this ->autoExit = $ autoExit ;
5151 }
5252
53- public function autoExit () : bool
53+ public function autoExit (): bool
5454 {
5555 return $ this ->autoExit ;
5656 }
@@ -60,7 +60,7 @@ public function setCli(bool $cli)
6060 $ this ->cli = $ cli ;
6161 }
6262
63- public function isCli () : bool
63+ public function isCli (): bool
6464 {
6565 if ($ this ->cli === null ) {
6666 $ this ->setCli (PHP_SAPI === 'cli ' );
@@ -115,7 +115,7 @@ public function setLogErrors(bool $logErrors)
115115 $ this ->logErrors = $ logErrors ;
116116 }
117117
118- public function logErrors () : bool
118+ public function logErrors (): bool
119119 {
120120 if ($ this ->logErrors === null ) {
121121 $ this ->setLogErrors (
@@ -132,7 +132,7 @@ public function setLogVariables(bool $logVariables)
132132 $ this ->logVariables = $ logVariables ;
133133 }
134134
135- public function logVariables () : bool
135+ public function logVariables (): bool
136136 {
137137 return $ this ->logVariables ;
138138 }
@@ -176,9 +176,9 @@ public function exceptionHandler(\Throwable $exception)
176176 $ line = $ lines [$ i ];
177177
178178 if (isset ($ line [$ width ])) {
179- $ lines [$ i ] = substr ($ line , 0 , $ width );
179+ $ lines [$ i ] = mb_substr ($ line , 0 , $ width );
180180 if (isset ($ line [0 ]) and $ line [0 ] !== '# ' ) {
181- array_splice ($ lines , $ i + 1 , 0 , ' ' . substr ($ line , $ width ));
181+ array_splice ($ lines , $ i + 1 , 0 , ' ' . mb_substr ($ line , $ width ));
182182 }
183183 }
184184
@@ -188,7 +188,7 @@ public function exceptionHandler(\Throwable $exception)
188188 $ this ->outputError (PHP_EOL );
189189 $ this ->outputError (sprintf ('<error> %s </error> ' , str_repeat (' ' , $ width )));
190190 foreach ($ lines as $ line ) {
191- $ this ->outputError (sprintf ('<error> %s%s </error> ' , $ line , str_repeat (' ' , max (0 , $ width - strlen ($ line )))));
191+ $ this ->outputError (sprintf ('<error> %s%s </error> ' , $ line , str_repeat (' ' , max (0 , $ width - mb_strlen ($ line )))));
192192 }
193193 $ this ->outputError (sprintf ('<error> %s </error> ' , str_repeat (' ' , $ width )));
194194 $ this ->outputError (PHP_EOL );
@@ -356,7 +356,7 @@ private function getExceptionCode(\Throwable $exception)
356356 return $ code ;
357357 }
358358
359- private function purgeTrace (string $ trace ) : string
359+ private function purgeTrace (string $ trace ): string
360360 {
361361 return defined ('ROOT_PATH ' ) ? str_replace (ROOT_PATH , '. ' , $ trace ) : $ trace ;
362362 }
0 commit comments