diff --git a/src/Core/Cache/CacheStateManager.php b/src/Core/Cache/CacheStateManager.php index 1b667b0..5ac1cf7 100644 --- a/src/Core/Cache/CacheStateManager.php +++ b/src/Core/Cache/CacheStateManager.php @@ -27,8 +27,8 @@ protected function getHash(): string { $transformerHash = parent::getHash(); - $advices = $this->aspectManager->getAdvices(); - $aspectHash = md5(serialize($advices)); + $aspectAdviceNames = $this->aspectManager->getAspectAdviceNames(); + $aspectHash = md5(serialize($aspectAdviceNames)); return $transformerHash . $aspectHash; } diff --git a/src/Core/Container/AspectManager.php b/src/Core/Container/AspectManager.php index 72c51eb..43eaf67 100644 --- a/src/Core/Container/AspectManager.php +++ b/src/Core/Container/AspectManager.php @@ -213,13 +213,19 @@ public function getAspectAdviceContainers(): array } /** - * Get the advice names. + * Get the aspect advice names. * * @return string[] */ - public function getAdvices(): array + public function getAspectAdviceNames(): array { - return array_keys($this->adviceContainers); + $aspectAdviceNames = []; + foreach ($this->aspects as $aspect) { + foreach ($this->aspectAdviceContainers[$aspect] as $adviceContainer) { + $aspectAdviceNames[] = $adviceContainer->getName(); + } + } + return $aspectAdviceNames; } /**