Skip to content

Commit

Permalink
Updated Rector to commit 6bd2b871c4e9741928fb48df3ca8e899be42be81
Browse files Browse the repository at this point in the history
rectorphp/rector-src@6bd2b87 [NodeTypeResolver] No need json_decode/json_encode for cache class name collection (#5881)
  • Loading branch information
TomasVotruba committed May 15, 2024
1 parent 7d70c58 commit 3c1e41f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '3cf5b1a2b89979dc375701d88608bc03d6a4a7dd';
public const PACKAGE_VERSION = '6bd2b871c4e9741928fb48df3ca8e899be42be81';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-05-15 09:00:44';
public const RELEASE_DATE = '2024-05-15 09:15:53';
/**
* @var int
*/
Expand Down
13 changes: 5 additions & 8 deletions src/FamilyTree/Reflection/FamilyRelationsAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,11 @@ private function loadClasses() : void
}
$key = $this->dynamicSourceLocatorProvider->getCacheClassNameKey();
$classNamesCache = $this->cache->load($key, CacheKey::CLASSNAMES_HASH_KEY);
if (\is_string($classNamesCache)) {
$classNamesCache = \json_decode($classNamesCache);
if (\is_array($classNamesCache)) {
foreach ($classNamesCache as $classNameCache) {
try {
$this->reflectionProvider->getClass($classNameCache);
} catch (ClassNotFoundException $exception) {
}
if (\is_array($classNamesCache)) {
foreach ($classNamesCache as $classNameCache) {
try {
$this->reflectionProvider->getClass($classNameCache);
} catch (ClassNotFoundException $exception) {
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function collectClasses(AggregateSourceLocator $aggregateSourceLocator,
}
$key = $this->getCacheClassNameKey();
$classNamesCache = $this->cache->load($key, CacheKey::CLASSNAMES_HASH_KEY);
if (\is_string($classNamesCache)) {
if (\is_array($classNamesCache)) {
return;
}
$reflector = new DefaultReflector($aggregateSourceLocator);
Expand All @@ -149,6 +149,6 @@ private function collectClasses(AggregateSourceLocator $aggregateSourceLocator,
}
} catch (CouldNotReadFileException $exception) {
}
$this->cache->save($key, CacheKey::CLASSNAMES_HASH_KEY, \json_encode($classNames));
$this->cache->save($key, CacheKey::CLASSNAMES_HASH_KEY, $classNames);
}
}

0 comments on commit 3c1e41f

Please sign in to comment.