Skip to content

Fix code quality issues in documentation code snippets#8192

Merged
dereuromark merged 1 commit into5.xfrom
fix/docs-code-quality-issues
Jan 29, 2026
Merged

Fix code quality issues in documentation code snippets#8192
dereuromark merged 1 commit into5.xfrom
fix/docs-code-quality-issues

Conversation

@dereuromark
Copy link
Member

Summary

Fixes code quality issues found during a 5.x documentation audit:

  • Critical: Remove return from void method in database-basics.md (initialize() had return parent::getSchema()->...)
  • Type hints: Add missing parameter and return type declarations to:
    • Point class (__construct, parse, lat, long)
    • PointType class (toPHP, marshal, toExpression) — also renamed $d to $driver
    • Validation methods (validationUpdate, validationCustomName, validatePasswords)
    • Entity accessors/mutators (_getTitle, _setTitle, _getFullName)
    • Error handler methods (missingWidget in both ErrorController and AppExceptionRenderer)
  • Missing return path: Add exception throw for unhandled case in toExpression() (previously had only a // Handle other cases. comment with no code)
  • Code style: Replace empty($id) with !$id for defined parameter in form.md

Files changed: database-basics.md, validation.md, entities.md, errors.md, form.md

- Remove return statement from void method in database-basics.md
- Add missing parameter and return type declarations to Point class,
  PointType, validation methods, entity accessors/mutators, and error
  handler methods
- Add proper exception throw for unhandled case in toExpression()
- Replace empty($id) with !$id for defined parameter in form.md
@dereuromark dereuromark marked this pull request as ready for review January 29, 2026 03:53
@dereuromark dereuromark requested a review from josbeir January 29, 2026 03:53
@dereuromark dereuromark merged commit b263076 into 5.x Jan 29, 2026
5 checks passed
@dereuromark dereuromark deleted the fix/docs-code-quality-issues branch January 29, 2026 07:35
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