@@ -28,7 +28,7 @@ class RobotLoader
28
28
{
29
29
use Nette \SmartObject;
30
30
31
- private const RETRY_LIMIT = 3 ;
31
+ private const RetryLimit = 3 ;
32
32
33
33
/** @var string[] */
34
34
public $ ignoreDirs = ['.* ' , '*.old ' , '*.bak ' , '*.tmp ' , 'temp ' ];
@@ -104,7 +104,7 @@ public function tryLoad(string $type): void
104
104
$ this ->loadCache ();
105
105
106
106
$ missing = $ this ->missingClasses [$ type ] ?? null ;
107
- if ($ missing >= self ::RETRY_LIMIT ) {
107
+ if ($ missing >= self ::RetryLimit ) {
108
108
return ;
109
109
}
110
110
@@ -126,7 +126,7 @@ public function tryLoad(string $type): void
126
126
127
127
if (!$ file || !is_file ($ file )) {
128
128
$ this ->missingClasses [$ type ] = ++$ missing ;
129
- $ this ->needSave = $ this ->needSave || $ file || ($ missing <= self ::RETRY_LIMIT );
129
+ $ this ->needSave = $ this ->needSave || $ file || ($ missing <= self ::RetryLimit );
130
130
unset($ this ->classes [$ type ]);
131
131
$ file = null ;
132
132
}
@@ -479,7 +479,7 @@ private function loadCache(): void
479
479
480
480
$ this ->cacheLoaded = true ;
481
481
482
- $ file = $ this ->getCacheFile ();
482
+ $ file = $ this ->generateCacheFileName ();
483
483
484
484
// Solving atomicity to work everywhere is really pain in the ass.
485
485
// 1) We want to do as little as possible IO calls on production and also directory and file can be not writable (#19)
@@ -525,7 +525,7 @@ private function saveCache($lock = null): void
525
525
// we have to acquire a lock to be able safely rename file
526
526
// on Linux: that another thread does not rename the same named file earlier
527
527
// on Windows: that the file is not read by another thread
528
- $ file = $ this ->getCacheFile ();
528
+ $ file = $ this ->generateCacheFileName ();
529
529
$ lock = $ lock ?: $ this ->acquireLock ("$ file.lock " , LOCK_EX );
530
530
$ code = "<?php \nreturn " . var_export ([$ this ->classes , $ this ->missingClasses , $ this ->emptyFiles ], true ) . "; \n" ;
531
531
@@ -559,7 +559,7 @@ private function acquireLock(string $file, int $mode)
559
559
}
560
560
561
561
562
- private function getCacheFile (): string
562
+ private function generateCacheFileName (): string
563
563
{
564
564
if (!$ this ->tempDirectory ) {
565
565
throw new \LogicException ('Set path to temporary directory using setTempDirectory(). ' );
0 commit comments