Skip to content

PHP extractor misses PHP 8.5 void casts and match arms #4202

Description

@joshbruce

Summary

The PHP AST extractor still emits partial-extraction warnings for valid PHP 8.5 syntax. In a PHP 8.5 application, Graphify 0.9.80 with tree-sitter-php 0.24.1 reports no symbols for seven files containing (void) SomeClass::someMethod(...), and a multiline parse error for a return (string) match (...) { EnumCase => ... } expression. The same repository produced ten warning candidates on Graphify 0.9.57; 0.9.80 reduces that to eight but does not cover these constructs.

Minimal syntax examples:

<?php
(void) SomeClass::someMethod($argument);

return (string) match ($mode) {
    SomeEnum::First => $object->first(),
    SomeEnum::Second => $object->second(),
};

PHP 8.5 accepts these forms. The current grammar reports an ERROR on the class name after (void) and fails to parse enum-qualified match arms in this return/cast context, which prevents useful file-level symbols from being extracted.

Expected behavior

The PHP extractor should parse these valid PHP 8.5 constructs and retain surrounding declarations, calls, and relationships. Please add parser regression tests for the snippets above; merely suppressing warnings would hide missing graph coverage.

Environment

  • PHP 8.5.2
  • Graphify 0.9.80 (also compared against 0.9.57)
  • tree-sitter-php 0.24.1

Repository evidence is from 8fold/site-mastering-the-mundane.apps issue #217. No application source was changed to work around the parser limitation.

No activity

Activity on this issue will appear here.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions