Skip to content

[Pointcut] Implement return-type pointcuts for framework, #370#371

Merged
lisachenko merged 2 commits into
2.xfrom
feature/return-type-pointcut
Nov 22, 2017
Merged

[Pointcut] Implement return-type pointcuts for framework, #370#371
lisachenko merged 2 commits into
2.xfrom
feature/return-type-pointcut

Conversation

@lisachenko

Copy link
Copy Markdown
Member

This PR extends pointcut syntax to support return typehints for PHP7

@lisachenko lisachenko added this to the 2.x milestone Nov 22, 2017
Comment thread src/Aop/Pointcut/PointcutGrammar.php Outdated
$pointcut = new SignaturePointcut(
PointFilter::KIND_METHOD,
$reference->getMemberNamePattern(),
$memberFilter);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Multi-line function call not indented correctly; expected 16 spaces but found 20
  • Closing parenthesis of a multi-line function call must be on a line by itself

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 2 new issues, 5 updated code elements

@lisachenko
lisachenko merged commit 56f1bef into 2.x Nov 22, 2017
@lisachenko
lisachenko deleted the feature/return-type-pointcut branch November 22, 2017 19:57
lisachenko added a commit that referenced this pull request Nov 22, 2017
* origin/2.x:
  [Pointcut] Implement return-type pointcuts for framework, #370 (#371)
lisachenko added a commit to goaop/idea-plugin that referenced this pull request Apr 10, 2026
…ullable types)

Adds optional return type matching to `execution()` pointcuts, matching the
Go! AOP Framework syntax (goaop/framework#371). Supports simple types, nullable
types (`?string`), wildcards (`*`, `**`), and fully-qualified class names.

Examples: `execution(public Example->method(*): string)`,
          `execution(public Example->method(*): ?string)`,
          `execution(public Example->method(*): \Ns\Class)`.

- Lexer: T_COLON (':') and T_QUESTION_MARK ('?') tokens
- Grammar: `returnTypePattern` rule, optional `(':' returnTypePattern)` in
  `methodExecutionReference`
- PSI: ReturnTypePattern interface/impl, MethodExecutionReference#getReturnTypePattern
- Domain: ReturnTypeFilter (Kotlin) performs glob-pattern matching against PHP
  method return types, respecting nullability
- Build: remove generateParser/generateLexer as automatic compile dependencies
  to prevent GrammarKit from overwriting manually-maintained PSI delegation methods

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants