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

Complete type hints and annotation comments #67

Merged
merged 7 commits into from
Nov 19, 2018

Conversation

peter279k
Copy link
Contributor

Changed log

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.

@emsifa
Copy link
Member

emsifa commented Nov 19, 2018

Wow thank you @peter279k . You're so fast. 👍

I will check it, or maybe I will directly update it in your branch.

protected $alias;

/** @var mixed */
Copy link
Contributor

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.

protected $required = false;

/** @var Attribute */
Copy link
Contributor

Choose a reason for hiding this comment

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

@var Attribute|null

*
* @return boolean
*/
public function isRequired(): bool
{
return $this->required === true;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

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;
Copy link
Contributor

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

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

Choose a reason for hiding this comment

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

@throws \Exception

@emsifa
Copy link
Member

emsifa commented Nov 19, 2018

I think it's good for now. I will merge it.

Thank you all. 😃

@emsifa emsifa merged commit 4dc604c into rakit:v1 Nov 19, 2018
@peter279k
Copy link
Contributor Author

@emsifa, thank you for your commits and concern. I appreciate your help :).

@peter279k peter279k deleted the add_type_hint branch November 19, 2018 14:03
@emsifa emsifa mentioned this pull request Nov 21, 2018
8 tasks
@emsifa emsifa mentioned this pull request Nov 29, 2018
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

3 participants