Skip to content

Modernise for PHP 8.2+ and replace dead CI - #33

Merged
Mezzle merged 2 commits into
masterfrom
modernise
Oct 28, 2026
Merged

Mezzle merged 2 commits into
masterfrom
modernise

Conversation

@Mezzle

@Mezzle Mezzle commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Summary

QueueJitsu hasn't been touched since 2020. It still targets PHP 7.2, and its ext-pcntl: ^7.2 constraint means Composer refuses to install it on PHP 8 at all. On PHP 8.5 it throws 18 deprecation notices per run. CI runs on Travis and GrumPHP, and both have stopped working.

This moves the library to PHP 8.2+ (the oldest PHP still getting security fixes), fixes the deprecations, and swaps the tooling for one GitHub Actions workflow. It breaks backwards compatibility, so it should ship as 5.0.0.

 composer.json
-  php ^7.2 || ^8.0, ext-pcntl ^7.2, predis ^1.1, psr/* ^1.0
+  php ^8.2, ext-pcntl *, predis ^3.3, psr/container ^1.1|^2, psr/log ^1.1|^2|^3
+  conflict psr/http-message <1.1
 tooling
-  .travis.yml, grumphp.yml, .codeclimate.yml, super-linter v3
+  .github/workflows/ci.yml (checks on 8.2, PHPStan on 8.2-8.5 + lowest deps)
+  .github/dependabot.yml
 src/
   strftime() -> date('D M d H:i:s T Y')     (deprecated in 8.1, gone in 9)
   Job::__construct(?string $id = null)      (implicit nullable deprecated in 8.4)
   typed properties, return types, public consts
   RedisAdapter::getStatus(unknown id)       TypeError -> []

Smaller changes:

  • Predis floor is 3.3 because 3.0 to 3.2 carry a CRLF command-injection advisory.
  • Predis 3 declares psr/http-message ^1.0, but its Stream::seek() fatals against 1.0. Hence the conflict. I hit this in the lowest-deps run.
  • Worker::__invoke() takes int|string. mez/queuejitsu-cli passes the interval straight from a Symfony Console option, which is a string.
  • Interfaces keep their signatures, so custom adapters and strategies don't need edits.
  • composer check now runs validate, normalize, php-cs-fixer, PHPStan level 8 and composer-require-checker.
  • The Deprecated message for tearDown said setUp. Fixed.
  • failed_at and worker:*:started now include the timezone. strftime('%Z') was printing nothing.

Evidence

I couldn't use Docker here, so I ran static PHP 8.2.32 and 8.5.8 builds against Valkey 9.1.3 built from source.

The smoke test enqueues a job that succeeds and one that throws, runs the forking worker, sends SIGQUIT, then reads the statuses and the failure record back from Redis.

  • Before (master, PHP 8.5): jobs complete, but with 18 deprecation notices from strftime(), Job::__construct and Predis 1.x. failed_at=Wed Oct 28 17:34:28 2026 has an empty timezone.
    After (8.2, 8.5, and 8.2 with --prefer-lowest): ok status=4 fail status=3 processed=2, failed_at=Wed Oct 28 17:38:05 UTC 2026, 0 notices.
  • Before: getStatus() for an unknown job fails with TypeError: json_decode(): Argument #1 ($json) must be of type string, null given.
    After: returns [].
  • Before (lowest deps, no conflict): Fatal error: Declaration of Predis\Connection\Resource\Stream::seek(...) must be compatible with Psr\Http\Message\StreamInterface::seek(...).
    After: psr/http-message resolves to 1.1 and the smoke test passes.
  • composer check passes on 8.2. PHPStan level 8 reports no errors on 8.5 or on 8.2 with lowest deps. composer audit finds no advisories.
  • Not verified: the workflow file itself until it runs here, and PHP 8.3/8.4 locally (CI covers them).

Merge Danger

Door: two-way while unreleased. Tagging 5.0.0 makes it one-way, because Packagist users will pick it up.
Blast Radius: anyone on PHP < 8.2, or anyone pinning Predis 1/2. mez/queuejitsu-cli requires mez/queuejitsu ^4 and predis ^1.1, so it needs its own bump before it can use this. Subclasses of AbstractWorker or Worker that redeclare the now-typed protected properties need types too.

Once this merges, the open Dependabot PRs #28, #29, #30, #31 and #32 are obsolete.

Reviewed with review-loop: 1 round with GPT-6.1 Sol. Verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Mezzle and others added 2 commits October 28, 2026 17:39
- Require PHP ^8.2; fix ext-pcntl/ext-posix constraints that blocked PHP 8
- Bump predis to ^3.3, ramsey/uuid ^4.7, laminas-eventmanager ^3.13,
  allow psr/container 2 and psr/log 2/3
- Replace strftime() (deprecated in 8.1) with date()
- Make Job's $id parameter explicitly nullable (8.4 deprecation)
- Add typed properties and return types; make JobManager constants public
- Return [] from RedisAdapter::getStatus() for unknown jobs instead of a TypeError
- Replace Travis, GrumPHP, Code Climate and Super-Linter with one GitHub
  Actions workflow; add Dependabot config
- Port php-cs-fixer config to v3 and PHPStan config to v2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dev tooling (composer-require-checker) pulls in an abandoned package,
which failed the audit without affecting library users.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Mezzle
Mezzle merged commit b25359a into master Oct 28, 2026
6 checks passed
@Mezzle
Mezzle deleted the modernise branch October 28, 2026 17:54
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