@@ -56,6 +56,8 @@ final class Config
5656
5757 private static bool $ vendorBoundaryOnly = true ;
5858
59+ private static bool $ cacheCheckMtime = true ;
60+
5961 private static string $ arrayValidation = 'full ' ;
6062
6163 public static function isEnabled (): bool
@@ -67,6 +69,15 @@ public static function isEnabled(): bool
6769 return self ::$ enabled ;
6870 }
6971
72+ public static function isCacheCheckMtimeEnabled (): bool
73+ {
74+ if (self ::$ cachedConfig === null ) {
75+ self ::get ();
76+ }
77+
78+ return self ::$ cacheCheckMtime ;
79+ }
80+
7081 public static function isParamsEnabled (): bool
7182 {
7283 if (self ::$ cachedConfig === null ) {
@@ -236,6 +247,7 @@ public static function get(): array
236247 'array_validation ' => 'full ' ,
237248 'cache ' => true ,
238249 'cache_dir ' => null ,
250+ 'cache_check_mtime ' => true ,
239251 'inline_vars ' => [
240252 'properties ' => true ,
241253 'generics ' => true ,
@@ -376,6 +388,7 @@ public static function reset(): void
376388 self ::$ respectNativeNullability = true ;
377389 self ::$ vendorBoundaryOnly = true ;
378390 self ::$ arrayValidation = 'full ' ;
391+ self ::$ cacheCheckMtime = true ;
379392
380393 DocblockParser ::reset ();
381394 ParamChecker ::reset ();
@@ -410,5 +423,6 @@ private static function syncFlags(array $config): void
410423 self ::$ respectNativeNullability = (bool ) ($ config ['respect_native_nullability ' ] ?? true );
411424 self ::$ vendorBoundaryOnly = (bool ) ($ config ['vendor_boundary_only ' ] ?? true );
412425 self ::$ arrayValidation = \is_string ($ config ['array_validation ' ] ?? null ) ? $ config ['array_validation ' ] : 'full ' ;
426+ self ::$ cacheCheckMtime = (bool ) ($ config ['cache_check_mtime ' ] ?? true );
413427 }
414428}
0 commit comments