Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix: Update dependencies for PHP 8.4 compatibility. by fago · Pull Request #45 · drunomics/phapp-cli · GitHub
Skip to content

fix: Update dependencies for PHP 8.4 compatibility. - #45

Merged
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility
Aug 31, 2026
Merged

fix: Update dependencies for PHP 8.4 compatibility.#45
fago merged 1 commit into
masterfrom
feature/43-php-8.4-compatibility

Conversation

@fago

@fagofago commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Fixes#43.

Problem

Running the released phar on PHP 8.4 prints implicit-nullable deprecations from the vendored consolidation/* packages. Because Lagoon's deploy log treats anything on stderr as an error, these show up as ERROR lines in deploy output:

ERROR: Consolidation\AnnotatedCommand\State\StateHelper::inject(): Implicitly marking parameter $output as nullable is deprecated, the explicit nullable type must be used instead in phar:///app/vendor/bin/phapp.phar-0.7.2/vendor/consolidation/annotated-command/src/State/StateHelper.php:32

What changed

composer update (no constraint changes needed — composer.json was already permissive enough):

PackageBeforeAfter
consolidation/annotated-command4.10.04.10.5
consolidation/config3.0.03.2.1
consolidation/output-formatters4.6.04.7.1
consolidation/robo5.1.05.1.1
consolidation/log3.1.03.1.2
grasmash/expander3.0.03.0.1
league/container4.2.44.2.5
composer/semver3.4.33.4.4
symfony/consolev6.4.15v6.4.45
symfony/processv7.1.8v7.4.18
symfony/dotenvv7.1.6v7.4.18
symfony/event-dispatcherv7.1.6v7.4.17
symfony/finderv7.1.6v7.4.17
symfony/stringv7.1.8v7.4.15
symfony/filesystemv6.4.13v6.4.45
symfony/yamlv6.4.13v6.4.45
symfony/service-contractsv3.5.0v3.7.3
symfony/deprecation-contractsv3.5.0v3.7.1
symfony/event-dispatcher-contractsv3.5.0v3.7.1
symfony/polyfill-*v1.31.0v1.37–1.42
phpstan/phpstan (dev)2.0.22.2.12
squizlabs/php_codesniffer (dev)3.7.23.13.6

The three bold ones are the packages that actually carried implicit-nullable signatures. annotated-command goes to 4.10.5 rather than the 4.10.1 named in the issue, since that is the current 4.x release and it contains the same fix.

src/ fixes — phapp-cli had two implicit-nullable signatures of its own, which would have started printing the same deprecation from within the phar:

- public function __construct($message = '…', $code = 0, \Exception $previous = NULL) {+ public function __construct($message = '…', $code = 0, ?\Exception $previous = NULL) {

in PhappEnvironmentUndefinedException and PhappInstanceNotFoundException. ?Type needs PHP 7.1, well below the declared php: >=7.4, so no constraint change is required.

Verification

Verified:

  • Reproduced the bug on PHP 8.4 (official php:8.4-cli image) against master's lockfile — php ./phapp list printed Consolidation\Config\Config::__construct(): Implicitly marking parameter $data as nullable is deprecated.
  • Fix confirmed on PHP 8.4 — after the update, ./phapp list, ./phapp help build and ./phapp status all run with error_reporting=E_ALL, display_errors=1 and print zero deprecations.
  • Built the phar with composer build (box 4.6.1) and ran ./phapp.phar list / help build / status on PHP 8.4 — also clean.
  • Static sweep of the whole tree with a token_get_all()-based scanner for typed non-nullable parameters defaulting to null: master had 5 real hits (consolidation/config ×1, consolidation/annotated-command ×2 — including the exact StateHelper.php:32 from the issue — and grasmash/expander ×2), plus the 2 in src/. After this change: 0 in src/ and 0 in the runtime vendor tree.
  • composer validate → valid; php -l clean over src/ and phapp.

Not verified / caveats:

  • No test suite exists in this repo, so there is no automated regression coverage. Verification was manual command execution as described above.
  • phpstan analyse src --level=0 reports 2 errors in src/ScriptHandler.php (Composer\Script\Event / Composer\Util\StreamContextFactory not found — composer/composer is not a dependency). These are pre-existing on master and untouched by this PR; there is no phpstan.neon in the repo, so PHPStan is not wired into any CI.
  • Only the commands reachable without a phapp.yml were exercised (list, help, status). The build / install / clone / create paths were not run against a real project, so the Symfony minor bumps (console 6.4.15 → 6.4.45, process/dotenv/finder 7.1 → 7.4) are unverified against real-world usage. All stay within the same major, and Symfony 6.4/7.4 are the current LTS lines.
  • symfony/console resolves to 6.4 rather than 7.x because consolidation/robo 5.1.1 caps it there — unchanged behaviour from before.

Note for consumers — a release is needed

Projects consume the released phar, not this repo, so nothing changes for them until a new release is cut: tag 0.7.3, run composer build, and upload phapp.phar to the GitHub release page (see README → "Create a new release"). Until then, Lagoon deploy logs will keep showing the ERROR: lines from 0.7.2. I have deliberately not created a release or tag here.


Follow-up:composer build itself turned out to be broken (box symlink left pointing at box 2.7.5 on pre-Dec-2024 checkouts, and box 4.6.1 does not run on PHP 8.4). Fixed separately in #46, which is required before a 0.7.3 phar can actually be built on PHP 8.4.

🤖 Generated with Claude Code

https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd

Running the phar on PHP 8.4 printed "Implicitly marking parameter $x as
nullable is deprecated" notices from vendored consolidation packages, which
surface as ERROR lines in deploy logs.
- composer update: consolidation/annotated-command 4.10.0 -> 4.10.5,
consolidation/config 3.0.0 -> 3.2.1, grasmash/expander 3.0.0 -> 3.0.1 and
the remaining consolidation/symfony dependencies along with them.
- Declare the $previous exception parameter explicitly nullable in
PhappEnvironmentUndefinedException and PhappInstanceNotFoundException.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ouHkvipwQik1mwsrrBmUd
@private-packagist

Copy link
Copy Markdown

composer.lock

Package changes

PackageOperationFromToAbout
composer/semverupgrade3.4.33.4.4diff
consolidation/annotated-commandupgrade4.10.04.10.5diff
consolidation/configupgrade3.0.03.2.1diff
consolidation/logupgrade3.1.03.1.2diff
consolidation/output-formattersupgrade4.6.04.7.1diff
consolidation/roboupgrade5.1.05.1.1diff
grasmash/expanderupgrade3.0.03.0.1diff
league/containerupgrade4.2.44.2.5diff
symfony/consoleupgradev6.4.15v6.4.45diff
symfony/deprecation-contractsupgradev3.5.0v3.7.1diff
symfony/dotenvupgradev7.1.6v7.4.18diff
symfony/event-dispatcherupgradev7.1.6v7.4.17diff
symfony/event-dispatcher-contractsupgradev3.5.0v3.7.1diff
symfony/filesystemupgradev6.4.13v6.4.45diff
symfony/finderupgradev7.1.6v7.4.17diff
symfony/polyfill-ctypeupgradev1.31.0v1.37.0diff
symfony/polyfill-intl-graphemeupgradev1.31.0v1.41.0diff
symfony/polyfill-intl-normalizerupgradev1.31.0v1.42.0diff
symfony/polyfill-mbstringupgradev1.31.0v1.38.2diff
symfony/polyfill-php81upgradev1.31.0v1.38.1diff
symfony/processupgradev7.1.8v7.4.18diff
symfony/service-contractsupgradev3.5.0v3.7.3diff
symfony/stringupgradev7.1.8v7.4.15diff
symfony/yamlupgradev6.4.13 ⚠️v6.4.45 ✅diff

Dev Package changes

PackageOperationFromToAbout
phpstan/phpstanupgrade2.0.22.2.12diff
squizlabs/php_codesnifferupgrade3.7.2 ⚠️3.13.6 ✅diff

Important Metadata Changes

PackageVersionMetadataFromTo
phpstan/phpstan2.2.12remove sourcehttps://github.com/phpstan/phpstan.git

Settings · Docs · Powered by Private Packagist

@fago
fago merged commit a2d35c3 into masterAug 31, 2026
@fagofago changed the title fix: Update dependencies for PHP 8.4 compatibility.fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.Aug 31, 2026
@fagofago changed the title fix: Update dependencies and repair the phar build for PHP 8.4 compatibility.fix: Update dependencies for PHP 8.4 compatibility.Aug 31, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

PHP 8.4 compatiblity

1 participant

@fago