Skip to content

PHPStan and Coverage Maxing#113

Merged
skydudie merged 12 commits intomasterfrom
Max-PHPStan
Apr 17, 2026
Merged

PHPStan and Coverage Maxing#113
skydudie merged 12 commits intomasterfrom
Max-PHPStan

Conversation

@skydudie
Copy link
Copy Markdown
Contributor

Proposed changes

This pull request introduces several improvements and clarifications to the codebase and documentation, with a focus on stricter type safety, improved configuration validation, and clearer deprecation/migration paths for consuming applications. It also updates documentation to reflect these changes and to clarify expected behaviors, especially around user identity handling and error cases.

Key changes include:

Type Safety & Validation

  • Added declare(strict_types=1); to all PHP files, enforcing strict type checking throughout the codebase. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Updated migration files to use explicit Blueprint type hints in schema callbacks for better IDE/type support. [1] [2] [3] [4]
  • Improved OpenID configuration validation by using strict string checks and custom exceptions for missing or invalid fields, leveraging a new TypeNarrow utility. [1] [2]

Configuration & Dependency Updates

  • Changed MyInfo controller references in config and documentation to use the correct namespace (MyInfo\... instead of SingPass\MyInfo...). [1] [2]
  • Enhanced provider config construction to use stricter extraction and validation methods for required config values.
  • Added phpstan/phpstan-phpunit as a dev dependency and updated PHPStan configuration for stricter static analysis. [1] [2]

Documentation & Deprecation Notices

  • Deprecated SingPassUser::getNric() in favor of the readonly $nric property, and updated all relevant documentation and upgrade notes to reflect this change. [1] [2] [3] [4]
  • Clarified MyInfo scope handling and error behavior in the documentation, specifying that malformed or non-JWT access tokens will now result in visible errors. [1] [2]
  • Improved DPoP algorithm environment variable documentation for clarity.

These changes collectively improve the reliability, maintainability, and clarity of both the codebase and its integration points for consumers.

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
  • I have added/updated tests that prove my fix is effective or that my feature works
  • I have added/updated necessary documentation (if appropriate)

@skydudie skydudie self-assigned this Apr 16, 2026
@skydudie skydudie added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 16, 2026
@private-packagist
Copy link
Copy Markdown

composer.lock

Dev Package changes

Package Operation From To About
phpstan/phpstan-phpunit add - 2.0.16 view code - License: MIT License

Settings · Docs · Powered by Private Packagist

skydudie and others added 4 commits April 16, 2026 22:10
# Conflicts:
#	config/myinfo.php
#	src/Http/Controllers/MyInfo/MyInfoCallbackController.php
#	src/Http/Controllers/MyInfo/MyInfoController.php
#	tests/Unit/Http/Controllers/MyInfo/MyInfoCallbackControllerTest.php
#	tests/Unit/Http/Controllers/MyInfo/MyInfoControllerTest.php
@sonarqubecloud
Copy link
Copy Markdown

@skydudie skydudie merged commit d1e9868 into master Apr 17, 2026
3 checks passed
@skydudie skydudie deleted the Max-PHPStan branch April 17, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant