@@ -159,6 +159,11 @@ public function exceptionHandler(Throwable $exception)
159159 public function errorHandler (int $ severity , string $ message , ?string $ file = null , ?int $ line = null )
160160 {
161161 if ($ this ->isDeprecationError ($ severity )) {
162+ // @TODO Remove if Faker is fixed.
163+ if ($ this ->isFakerDeprecationError ($ message , $ file , $ line )) {
164+ return true ;
165+ }
166+
162167 if (! $ this ->config ->logDeprecationsOnly || (bool ) env ('CODEIGNITER_SCREAM_DEPRECATIONS ' )) {
163168 throw new ErrorException ($ message , 0 , $ severity , $ file , $ line );
164169 }
@@ -167,12 +172,6 @@ public function errorHandler(int $severity, string $message, ?string $file = nul
167172 }
168173
169174 if (error_reporting () & $ severity ) {
170- // @TODO Remove if Faker is fixed.
171- if ($ this ->isFakerDeprecationError ($ severity , $ message , $ file , $ line )) {
172- // Ignore the error.
173- return true ;
174- }
175-
176175 throw new ErrorException ($ message , 0 , $ severity , $ file , $ line );
177176 }
178177
@@ -184,11 +183,10 @@ public function errorHandler(int $severity, string $message, ?string $file = nul
184183 *
185184 * @see https://github.com/FakerPHP/Faker/issues/479
186185 */
187- private function isFakerDeprecationError (int $ severity , string $ message , ?string $ file = null , ?int $ line = null )
186+ private function isFakerDeprecationError (string $ message , ?string $ file = null , ?int $ line = null )
188187 {
189188 if (
190- $ severity === E_DEPRECATED
191- && strpos ($ file , VENDORPATH . 'fakerphp/faker/ ' ) !== false
189+ strpos ($ file , VENDORPATH . 'fakerphp/faker/ ' ) !== false
192190 && $ message === 'Use of "static" in callables is deprecated '
193191 ) {
194192 log_message (
0 commit comments