Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Class manifest is not caching enums #11532

Open
wants to merge 2 commits into
base: 5.3
Choose a base branch
from

Conversation

lekoala
Copy link
Contributor

@lekoala lekoala commented Jan 7, 2025

Description

Fix #11531

Enums were not being added to cache, but validated and required

Manual testing steps

See related issue

Basically, this will ensure that validateItemCache will actually return true
Currently it will always return false unless i've missed something somewhere...

Issues

Fixes #11531

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@lekoala
Copy link
Contributor Author

lekoala commented Jan 7, 2025

Actually now i see why enums are not there

if ($changed && $this->cache) {
$cache = [
'classes' => $classes,
'interfaces' => $interfaces,
'traits' => $traits,
];
$this->cache->set($key, $cache);
}

@lekoala lekoala changed the title FIX Class manifest don't require enums FIX Class manifest is not caching enums Jan 7, 2025
@lekoala
Copy link
Contributor Author

lekoala commented Jan 7, 2025

For reference, it's due to this PR
d3f1043

which seems to have forgotten to store the enums in the cache

@kinglozzer did I miss something here?

@kinglozzer
Copy link
Member

I can’t remember (or think of) any reason why they shouldn’t be included in the cache, so it’s probably just an oversight in the original PR

@lekoala
Copy link
Contributor Author

lekoala commented Jan 7, 2025

an additionnal improvement would be to not store empty arrays and simply consider missing keys as empty arrays.
this should reduce the cache size by a large margin, because it's currently storing a lot of empty traits => [] and enums => []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants