Fix critical method signature mismatches with 5.x source#8179
Merged
Conversation
Fixes method signatures that were wrong, referenced nonexistent methods, or had extra/missing parameters compared to the actual CakePHP 5.x source code. Relates to #7744. Changes: - Entity::dirty() -> isDirty() (dirty() does not exist in 5.x) - Table::get() updated to match new named-parameter signature - Table::find() add type and default for $type parameter - RouteBuilder::extensions() -> setExtensions() (extensions() does not exist) - PaginatorHelper::counter() remove nonexistent $options parameter - PaginatorHelper::generateUrl() remove nonexistent $model parameter - PaginatorHelper::hasNext() remove nonexistent $model parameter - Controller::addViewClasses() add missing $viewClasses parameter - Cache::add() fix syntax error (missing comma) and add types
josbeir
approved these changes
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes critical method signature mismatches between the documentation and the actual CakePHP 5.x source code. Relates to #7744.
These are the signatures that were fundamentally wrong (nonexistent methods, extra/missing parameters, syntax errors) — not just missing types.
Entity::dirty()→isDirty()—dirty()does not exist in 5.x, replaced byisDirty()/setDirty()Table::get($id, $options = [])→get(mixed $primaryKey, array|string $finder = 'all', ...)— completely different signature since the$optionsarray was replaced by named parametersTable::find($type, ...)→find(string $type = 'all', ...)— added type and defaultRouteBuilder::extensions()→setExtensions()—extensions()does not exist, split intosetExtensions()/addExtensions()/getExtensions()PaginatorHelper::counter($format, $options)→counter(string $format = 'pages')—$optionsparameter does not existPaginatorHelper::generateUrl(..., $model, ...)→ removed$model— parameter does not existPaginatorHelper::hasNext($model)→hasNext()— no parameters in sourceController::addViewClasses()→addViewClasses(array $viewClasses)— was missing required parameterCache::add($key, $value $config)→add(string $key, mixed $value, string $config = 'default')— had syntax error (missing comma) and missing types