-
Notifications
You must be signed in to change notification settings - Fork 140
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
Complete type hints and annotation comments #67
Conversation
Wow thank you @peter279k . You're so fast. 👍 I will check it, or maybe I will directly update it in your branch. |
src/Attribute.php
Outdated
protected $alias; | ||
|
||
/** @var mixed */ |
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.
This should be @var Validation
. as per the constructor, nothing else except an instance of Validation
is accepted.
src/Attribute.php
Outdated
protected $required = false; | ||
|
||
/** @var Attribute */ |
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.
@var Attribute|null
src/Attribute.php
Outdated
* | ||
* @return boolean | ||
*/ | ||
public function isRequired(): bool | ||
{ | ||
return $this->required === true; |
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.
Unrelated to this PR... But isn't required
already a boolean? Why compare to true
again.
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.
@adelowo , yeah....This condition === true
is useless.
This should be return the value directly.
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.
Yes, it's useless, I'm not sure why I put it there 😄
src/Rule.php
Outdated
* | ||
* @return boolean | ||
*/ | ||
public function isImplicit(): bool | ||
{ | ||
return $this->implicit === true; |
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.
Same as my other comment
* | ||
* @param mixed $value | ||
* @return mixed | ||
* @throws Exception |
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 this should be @throws \Exception
if it refers to the standard library's Exception class
* Throw exception | ||
* | ||
* @param string $value | ||
* @return Exception |
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.
@throws \Exception
I think it's good for now. I will merge it. Thank you all. 😃 |
@emsifa, thank you for your commits and concern. I appreciate your help :). |
Changed log
PHPDoc
style and internal PHP type hints to complete the type hints for all codes insrc
folder.I'm not sure that these type hints or annotation comments are set the correct type hints/comments.
@emsifa, please check that and write down some comments/request changes.
Thanks.