Skip to content

chore(opcache): replace path-scoped PHPStan ignores with struct shapes #126

Closed

Description

@lisachenko

Follow-up to the OpCache binary-file API (#111, merged). Tech debt.

PayloadRelocator and ReflectionOpcacheFile are held to level max via path-scoped ignore entries in phpstan.dist.neon (property.nonObject, binaryOp.invalid, cast.int, argument.type) because their multi-hop FFI\CData reads ($zval->u1->v->type, $zval->value->str, …) resolve to mixed after the first hop. This is consistent with the repo's "FFI blast radius" stance but is looser than the rest of the codebase, which uses named PHPStan object shapes (ZendOpArrayShape, etc.) surfaced by typed accessors.

Scope: introduce named shapes (e.g. ZendPersistentScriptShape, ZendScriptShape, plus zval/hash/class-entry shapes as needed) and narrow at the read sites, then remove the per-file ignore blocks. Keep only the genuinely irreducible CData ignores. Purely internal; no behaviour change.

No chore label exists in this repo; flagging the nature here.

Activity

  1. added
    enhancementNew feature or request
    opcacheIssue is related to opcache integration. Either doesn't work well or behaves incorrect.
    on Aug 5, 2026
  2. added 2 commits that reference this issue on Aug 20, 2026
    0057a39
    225bbca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreenhancementNew feature or requestopcacheIssue is related to opcache integration. Either doesn't work well or behaves incorrect.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions