Skip to content

allow method calls in expressions without parenthesis and is/has #60336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tacman opened this issue May 3, 2025 · 0 comments
Open

allow method calls in expressions without parenthesis and is/has #60336

tacman opened this issue May 3, 2025 · 0 comments

Comments

@tacman
Copy link
Contributor

tacman commented May 3, 2025

Description

Like twig, I'd like to be able to call methods in expressions without the parenthesis.

Example

public function isValid() {
   return $this->httpStatusCode == 200;
}

In the expression, e.g. for workflow

 guard: 'subject.isValid()'

I'd like to be able to call it without the parenthsis.

And like Twig, it'd be great to not need the is or has prefix,

 guard: 'subject.valid'
@tacman tacman changed the title Allow method calls in expressions to be called without () has is/has allow method calls in expressions without parenthesis and is/has May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants