Skip to content

Move to Psalm 7 - #157

Merged
PDowney merged 2 commits into
mainfrom
psalm-7
Nov 14, 2026
Merged

PDowney merged 2 commits into
mainfrom
psalm-7

Conversation

@PDowney

@PDowney PDowney commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves static analysis to Psalm 7 (vimeo/psalm ^7.0, locked at 7.5.0). Replaces Dependabot's #153, which failed Psalm; php-cs-fixer, PHPStan, Rector, and sebastian/version from that group are updated here too.

  • Redundant casts: six (string) casts of request values that is_string() had already checked are removed (includes/download.php, includes/export.php). wp_unslash() keeps the type it is given.
  • Direct-access guards: Psalm 7.5 reports each included file's if ( ! defined( 'ABSPATH' ) ) guard as redundant and paradoxical, because the main plugin file checks the same constant first and the Psalm stub defines it. The guards still matter for a direct request, so each carries a @psalm-suppress note instead of being removed.
  • WordPress stubs: Psalm 7 rejects 31 docblocks in php-stubs/wordpress-stubs. psalm.xml suppresses InvalidDocblock for that file only; the plugin's own docblocks are still checked.
  • Changelog entries in CHANGELOG.md and readme.txt; the POT file's line references moved.

Testing

  • composer psalm, composer psalm:taint: no errors with Psalm 7.5.0.
  • composer phpstan, composer phpcs, composer phpmd, composer rector: clean.
  • composer test: 230 tests pass.
  • phpcs-plugin-check on the changed files: clean. npm run lint:md: clean.

🤖 Generated with Claude Code

vimeo/psalm ^7.0 (7.5.0), with php-cs-fixer, PHPStan, Rector, and
sebastian/version updated alongside (Dependabot's group). Six (string)
casts of request values already checked with is_string() are removed.
The included files' ABSPATH guards carry a Psalm note: Psalm 7.5 reads
them as decided by the main file's check. InvalidDocblock is not
reported for the WordPress stubs file, which Psalm 7 rejects in places.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for contributing to EngineScript Site Exporter!

Before we review:

  • Have you tested your changes with WordPress 7.0+?
  • Are your changes compatible with PHP 8.3+?
  • Have you followed WordPress coding standards?
  • Did you update the CHANGELOG.md if needed?

Security Reminder
This plugin creates site export archives, so please ensure:

  • All user input is properly sanitized
  • All output is properly escaped
  • No security vulnerabilities are introduced

We'll review your PR soon.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

The WordPress test job pins PHPUnit 9.6, and Psalm 7.4 and later
require psalm/plugin-phpunit, whose 1.x releases conflict with PHPUnit
below 11, so Composer could not resolve. The job does not run Psalm, so
it removes Psalm before pinning PHPUnit.

Psalm on GitHub (PHP 8.3) reported MixedAssignment for the network
cleanup loop's site IDs; the loop now takes the numeric IDs as integers
(array_filter, then array_map with intval), as the is_numeric() check
and (int) cast did before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@PDowney
PDowney merged commit 9b6066c into main Nov 14, 2026
27 checks passed
@github-actions
github-actions Bot deleted the psalm-7 branch November 14, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant