Skip to content
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

Add ary function which ignores arguments over the supplied number #215

Merged
merged 4 commits into from Jun 9, 2020

Conversation

someonewithpc
Copy link
Contributor

Added function which defines a function of an arbitry number of arguments and
calls the provided callable with only the given number of arguments

Didn't add tests as it wasn't obvious how they worked and wanted feedback before investing the time

@lstrojny
Copy link
Owner

In lodash this function is called ary(https://lodash.com/docs/4.17.15#ary). What do you think?

@someonewithpc
Copy link
Contributor Author

someonewithpc commented Mar 29, 2020

Maybe arity(callable, int): callable, then?

@lstrojny
Copy link
Owner

I would just follow lodash‘s naming precedence

@someonewithpc someonewithpc changed the title Add ignore_args which ignores arguments over the supplied number Add ary function which ignores arguments over the supplied number May 20, 2020
@someonewithpc
Copy link
Contributor Author

@lstrojny Renamed the function and added tests (the build fail seems to be unrelated and fixed by my other PR)

@lstrojny
Copy link
Owner

Care to document the function in the docs as well?

@someonewithpc
Copy link
Contributor Author

@lstrojny added documentation to the tests commit.

Added function which defines a function of an arbitry number of arguments and
calls the provided callable with only the given number of arguments

As suggested by @lstrojny, using the name `ary`, like in https://lodash.com/docs/4.17.15#ary
@lstrojny
Copy link
Owner

lstrojny commented May 27, 2020

Great, thank you!

One last thing, can you check https://travis-ci.org/github/lstrojny/functional-php/jobs/691301121 and fix the coding style errors, then we are ready to merge this

@someonewithpc
Copy link
Contributor Author

How does it check those? I ran php-cs-fixer (from vendor/bin) and it didn't fiz it

@lstrojny
Copy link
Owner

lstrojny commented Jun 3, 2020

How does it check those? I ran php-cs-fixer (from vendor/bin) and it didn't fiz it

That PHP code sniffer. Run phpcs to see the errors.

@someonewithpc
Copy link
Contributor Author

Ok, should be ready to merge, now

@lstrojny lstrojny merged commit f965945 into lstrojny:master Jun 9, 2020
@lstrojny
Copy link
Owner

lstrojny commented Jun 9, 2020

Great, thank you!

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.

None yet

2 participants