Skip to content

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

Merged
lstrojny merged 4 commits into
lstrojny:masterfrom
someonewithpc:master
Jun 9, 2020
Merged

lstrojny merged 4 commits into
lstrojny:masterfrom
someonewithpc:master

Conversation

@someonewithpc

Copy link
Copy Markdown
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
Copy Markdown
Owner

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

@someonewithpc

someonewithpc commented Mar 29, 2020 •

Copy link
Copy Markdown
Contributor Author

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

@lstrojny

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

Care to document the function in the docs as well?

@someonewithpc

Copy link
Copy Markdown
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

lstrojny commented May 27, 2020 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
Contributor Author

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

@lstrojny

lstrojny commented Jun 3, 2020

Copy link
Copy Markdown
Owner

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
Copy Markdown
Contributor Author

Ok, should be ready to merge, now

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

lstrojny commented Jun 9, 2020

Copy link
Copy Markdown
Owner

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.

2 participants