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 doc blocks, type hinting. Make stricter. #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jrdnrc
Copy link

@jrdnrc jrdnrc commented Oct 12, 2018

Everyone likes doc blocks.

Copy link
Owner

@meadsteve meadsteve left a comment

Choose a reason for hiding this comment

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

Couple of small requests for change but looks 👍

@@ -9,10 +9,24 @@ class Curried
*/
private $func;

/**
* @var array
Copy link
Owner

Choose a reason for hiding this comment

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

yeah I'm going to veto this bit of the change. It doesn't seem to add any additional information

Copy link
Author

Choose a reason for hiding this comment

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

How about mixed[] - it would indicate an Array of variable types 🤔

Copy link
Owner

Choose a reason for hiding this comment

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

good point. I think I like mixed[] better as it's more explicit that we expect a mix rather than just didn't bother specifying the type.

private $arity;

public function __construct($callable, $arity = null)
/**
* Curried constructor.
Copy link
Owner

Choose a reason for hiding this comment

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

The @param s I like but I'd remove 'Curried constructor.' as it doesn't add any extra information,

Copy link
Author

Choose a reason for hiding this comment

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

PHPStorm default - don't even notice them any more. Can remove 😄

Copy link
Owner

Choose a reason for hiding this comment

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

yeah it's a pet peeve of mine comments that say things like "add one to x". I probably spend more time than is sensible editing phpstorm's defaults.

@@ -24,18 +38,26 @@ public function __construct($callable, $arity = null)
public function __invoke()
{
$arguments = func_get_args();
if (count($this->args) == $this->arity - count($arguments)) {
if (count($this->args) === $this->arity - count($arguments)) {
Copy link
Owner

Choose a reason for hiding this comment

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

mmmm strict 👍

private $object;

/**
* CurryWrapper constructor.
Copy link
Owner

Choose a reason for hiding this comment

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

I'd remove the string "CurryWrapper" constructor as it doesn't add any extra information.

private $args = [];

/**
span class="pl-s1"> * @var integer
Copy link
Owner

Choose a reason for hiding this comment

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

I think you may have slipped on your keyboard here 😆 🤣

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