Skip to content

Conversation

@lacatoire
Copy link

Summary

This PR introduces explicit type declarations for class constants, leveraging the feature introduced in PHP 8.3.

Motivation

  • Enhances type safety and static analysis.
  • Makes code intent clearer.
  • Prepares PhD for PHP 8.4 compatibility and future strictness.

Scope

  • Added types such as int, string, bool, or array to class constants.
  • Example:
    Before:
    public const FORMAT_HTML = 1;
    public const NAME = 'PhD';
    After:
    public const int FORMAT_HTML = 1;
    public const string NAME = 'PhD';

Impact

  • ✅ No runtime behavior change.
  • ✅ Fully backward compatible with PHP 8.3+.
  • ⚙️ Code clarity and safety improvement only.

References

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.

1 participant