Skip to content

PHP 8.4/8.5 support, DBAL 4, 70% test coverage & OSS release prep - #1

Merged
Xakki merged 6 commits into
masterfrom
chore/oss-php85-release
May 21, 2026
Merged

PHP 8.4/8.5 support, DBAL 4, 70% test coverage & OSS release prep#1
Xakki merged 6 commits into
masterfrom
chore/oss-php85-release

Conversation

@Xakki

@Xakki Xakki commented May 21, 2026

Copy link
Copy Markdown
Owner

Summary

Prepares the project for an open-source release: full PHP 8.4 / 8.5 support, migration to doctrine/dbal 4, a unit + integration test suite at 70% line coverage, a green static-analysis/style tool-chain, and the standard OSS project files (GPL-3.0).

Tool-chain status (PHP 8.4 & 8.5)

Check Result
composer validate --strict valid
phpcs (PSR-12 strict) clean
phpstan level 7 (src + tests) 0 errors
phpunit 95 tests, 267 assertions, OK
Coverage 70.11% lines / 70.00% methods

What changed

  • Dependencies: php >=8.4, DBAL ^4.2, migrations ^3.8, PHPUnit ^11.5, PHPStan ^2.1, PHPCS ^3.11; dropped Psalm; fixed the misspelled llicense: proprietarylicense: GPL-3.0-or-later.
  • DBAL 4 migration of the repository layer (ArrayParameterType, executeStatement for writes, tightened $types).
  • Tests moved src/test/phpunittests/ (Xakki\Emailer\Tests, autoload-dev), modernized phpunit.xml; added unit + in-memory-SQLite integration suites.
  • Static analysis / style: cleared all PHPStan L7 and PSR-12 findings (root fixes; suppressions only for intentional override hooks / config-key naming, each commented).
  • OSS files: GPLv3 LICENSE, English README, CONTRIBUTING, CHANGELOG, GitHub Actions CI matrix with a ≥70% coverage gate, reusable docker/ci/Dockerfile.

Latent bugs found & fixed (via integration tests)

  • Controller\Mail::initQueue warned / mis-parsed keys without a - separator.
  • AbstractController::renderImage called mime_content_type() on file bytesTypeError on null bytes.
  • Nullable schema columns (campaign.params/replacers, queue_data.last_error/transport_id, stats.uri_ref/domain_id) mapped to non-nullable typed properties; campaign counters lacked defaults → "accessed before initialization".

Notes

  • 3 remaining PHPUnit deprecations come from phroute/phroute 2.2 (implicit-nullable params) — vendor-only, CI stays green.
  • composer require xakki/emailer works once published to Packagist; README documents a VCS fallback until then.

Xakki and others added 6 commits May 21, 2026 22:13
- php constraint ^8.2 -> >=8.4
- doctrine/dbal ^3.6 -> ^4.2, doctrine/migrations ^3.8
- phpunit ^10 -> ^11.5, phpstan ^1.10 -> ^2.1, phpcs ^3.11, drop psalm
- fix llicense typo -> license: GPL-3.0-or-later; add keywords/support/autoload-dev

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ArrayParameterType::STRING instead of removed 'array' string type
- delete() uses executeStatement() (writes must not go through executeQuery)
- tighten $types PHPDoc to ParameterType|Type|string

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- move src/test/phpunit -> tests/ (namespace Xakki\\Emailer\\Tests, autoload-dev)
- rewrite phpunit.xml to 11.x schema with <source> coverage scope
- DBAL 4 mocks, #[DataProvider], drop getMockForAbstractClass/enableProxyingToOriginalMethods

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Static analysis (phpstan paths src+tests, level 7 -> 0 errors) and PSR-12:
- typed PHPDoc, parse_url offset guards, class-string<> generics, secret_key sniff
- phpcs <file>src</file> + ignores for intentional override hooks

Runtime bugs surfaced by integration tests:
- Controller\\Mail::initQueue: guard keys without '-' separator
- AbstractController::renderImage: mime_content_type on path, not file bytes
- Campaign $params/$replacers nullable + counter defaults; QueueData/Stats nullable props

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- in-memory SQLite integration harness (tests/Support/IntegrationCase.php)
- cover Emailer, Mail, Tools, exceptions, models, repositories, CQRS, controllers, Smtp::validate
- 95 tests; line coverage 70.11%, method coverage 70.00% on PHP 8.4 & 8.5

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…OG, CI

- GPLv3 LICENSE; comprehensive English README; CONTRIBUTING + CHANGELOG
- GitHub Actions matrix (PHP 8.4/8.5): validate, cs-check, phpstan, phpunit, coverage gate >=70%
- reusable docker/ci/Dockerfile; ignore build/ and .phpunit.cache/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Xakki
Xakki merged commit 8551636 into master May 21, 2026
3 checks passed
@Xakki
Xakki deleted the chore/oss-php85-release branch May 21, 2026 20:22
Xakki added a commit that referenced this pull request May 24, 2026
* docs: simplify install (package is on Packagist)
* refactor(routing): replace unmaintained phroute with built-in Router

phroute/phroute (last release 2018) emitted implicit-nullable deprecations that
become fatal on PHP 9. It was used only by Emailer::dispatchRoute and a handler
resolver — both replaced by a ~70-line Helper\Router that keeps the exact same
route DSL (filters :i/:a/:c/:h), so ConfigService::$route is unchanged.

- add src/Helper/Router.php (+ RouterTest); fold handler resolution into dispatchRoute
- remove src/Helper/HandlerResolverRoute.php and the phroute dependency
- dispatchRoute now sets the response code from the exception's httpCode
- 101 tests green on PHP 8.4 & 8.5, 0 deprecations, line coverage 70.26%
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