Skip to content

Allow cleaner access syntax in expressions #709

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

Merged
merged 1 commit into from
Jul 11, 2020

Conversation

murtukov
Copy link
Contributor

@murtukov murtukov commented Jul 10, 2020

This PR adds a magic __get method to the Argument class, to allow a cleaner syntax in the expressions.

Instead of this:

@=res('my_resolver', [args['firstName'], args['lastName']])

We can write this:

@=res('my_resolver', [args.firstName, args.lastName])

which is obviously easier to read and is shorter.

And inside resolvers user can do $args->firstName, $args->lastName

@murtukov murtukov requested a review from mcg-web July 10, 2020 10:29
@mcg-web
Copy link
Contributor

mcg-web commented Jul 10, 2020

Can you also add an update note please?

@murtukov
Copy link
Contributor Author

What update note? Where?

@mcg-web
Copy link
Contributor

mcg-web commented Jul 10, 2020

In UPGRADE-1.0.md to describe the change done to public interface.

@murtukov
Copy link
Contributor Author

@mcg-web done

@murtukov murtukov force-pushed the feature/args-clean-syntax branch from 21c113f to 87ca419 Compare July 11, 2020 05:42
@mcg-web
Copy link
Contributor

mcg-web commented Jul 11, 2020

Thank you @murtukov !

@mcg-web mcg-web merged commit 4bc9e70 into overblog:master Jul 11, 2020
@murtukov murtukov deleted the feature/args-clean-syntax branch November 4, 2020 10:24
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