Skip to content

Conversation

@dereuromark
Copy link
Contributor

Summary

The isFullyTyped() method in DocBlockSniff would crash with:

Undefined array key "scope_opener"

when analyzing abstract methods or interface methods, which don't have a scope_opener token (they end with a semicolon instead of {...}).

Changes

  • Check if scope_opener exists before using it
  • For abstract/interface methods, search for the semicolon that ends the method declaration instead

Test case

This code would previously crash:

abstract class Foo
{
    abstract public function bar(): void;
}

🤖 Generated with Claude Code

The isFullyTyped() method would crash with "Undefined array key
scope_opener" when analyzing abstract methods or interface methods,
which don't have a scope_opener token.

This fix handles the case by searching for the method's semicolon
instead when no scope_opener exists.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dereuromark dereuromark marked this pull request as ready for review November 27, 2025 12:15
@dereuromark dereuromark merged commit 0220202 into master Nov 27, 2025
4 checks passed
@dereuromark dereuromark deleted the fix-docblock-scope-opener-bug branch November 27, 2025 12:15
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.

2 participants