Skip to content

Declare Strict Types#112

Merged
skydudie merged 2 commits intomasterfrom
Declare-Strict-Types
Apr 16, 2026
Merged

Declare Strict Types#112
skydudie merged 2 commits intomasterfrom
Declare-Strict-Types

Conversation

@skydudie
Copy link
Copy Markdown
Contributor

Proposed changes

This pull request introduces a code quality improvement across the codebase by enforcing strict type checking. The declare(strict_types=1); directive is added at the top of all PHP files, which helps catch type-related bugs early and ensures better type safety throughout the project.

Code quality and type safety improvements:

  • Added declare(strict_types=1); to all configuration files, including config/corppass-login.php, config/myinfo.php, config/ndi.php, and config/singpass-login.php, to enforce strict type checking in configuration logic. [1] [2] [3] [4]
  • Updated all migration and factory files, such as database/factories/UserFactory.php, database/migrations/add_corppass_entity_id_to_users_table.php, and database/migrations/add_nric_to_users_table.php, with strict types declaration. [1] [2] [3]
  • Applied strict type checking to all DTOs, events, and exception classes in the src/DTOs, src/Events, and src/Exceptions directories (e.g., FapiCallbackResult.php, ProviderConfig.php, CorpPassDataRetrievedEvent.php, AuthFlowException.php, etc.). [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Ensured strict types are enforced in the main routes file, routes/web.php.

These changes help improve code reliability and maintainability by making type errors more visible during development and testing.

Checklist

  • Unit/Feature tests passed and maintained at 80% coverage
  • Label either New feature, Bugfix, Breaking change, Refactoring, DevOps, or Documentation on GitHub
  • I have reviewed the changes myself

@skydudie skydudie self-assigned this Apr 16, 2026
@skydudie skydudie added the enhancement New feature or request label Apr 16, 2026
@sonarqubecloud
Copy link
Copy Markdown

@skydudie skydudie merged commit aec1264 into master Apr 16, 2026
3 checks passed
@skydudie skydudie deleted the Declare-Strict-Types branch April 16, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant