-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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,
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 😆 🤣
Everyone likes doc blocks.