Skip to content

Commit

Permalink
Fix phpstan for EvalLoader::$lockMap
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMeshok committed Oct 11, 2024
1 parent b189acb commit 68d65ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Loader/EvalLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
final class EvalLoader implements ClassLoaderInterface
{
/** @var array<class-string, true> */
private static array $lockMap = [];

public function __construct(
Expand All @@ -34,7 +35,7 @@ public function loadClass(MapperMetadata $mapperMetadata): void
if (isset(self::$lockMap[$mapperMetadata->className])) {
do {
usleep(100000); // 0.1 second
} while (isset(self::$lockMap[$mapperMetadata->className]));
} while (isset(self::$lockMap[$mapperMetadata->className])); // @phpstan-ignore isset.offset

if (class_exists($mapperMetadata->className, false)) {
return;
Expand Down

0 comments on commit 68d65ac

Please sign in to comment.