Skip to content

Commit

Permalink
MemoizingReflectionProvider - cache hasClass() as case-sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 11, 2021
1 parent 40fc32f commit 792ce0a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ public function __construct(ReflectionProvider $provider)

public function hasClass(string $className): bool
{
$lowerClassName = strtolower($className);
if (isset($this->hasClasses[$lowerClassName])) {
return $this->hasClasses[$lowerClassName];
if (isset($this->hasClasses[$className])) {
return $this->hasClasses[$className];
}

return $this->hasClasses[$lowerClassName] = $this->provider->hasClass($className);
return $this->hasClasses[$className] = $this->provider->hasClass($className);
}

public function getClass(string $className): ClassReflection
Expand Down

0 comments on commit 792ce0a

Please sign in to comment.