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

Fix incorrect docblock var and return types #264

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

munkie
Copy link
Contributor

@munkie munkie commented Sep 14, 2015

This PR fixes:

  • Incorrect @var and @return docblock tags types
  • Adds missing type hints
  • Fixes some incorrect comparisons (ie: preg_match returns integer while interface requires return type to be bool)

@@ -249,7 +249,7 @@ private function validateOptions(array $options)
if (false === is_object($provider) && false === is_string($provider)) {
throw new \InvalidArgumentException(sprintf(
'The provider should be a string or an object, got %s instead',
is_scalar($provider) ?$provider :gettype($provider)
is_scalar($provider) ? $provider : gettype($provider)
Copy link
Member

Choose a reason for hiding this comment

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

why the space after?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Personally, I prefer it as well. We do have a CS checker, but I'm not sure if it handles this situation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's the result of php-cs-fixer run with rules you configured in .php_cs

Copy link
Collaborator

Choose a reason for hiding this comment

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

🏆

@theofidry
Copy link
Member

+1 for this PR, good work

@@ -22,7 +22,7 @@ class ListName implements MethodInterface
*/
public function canBuild($name)
{
return preg_match('#\{([^,]+(\s*,\s*[^,]+)*)\}#', $name, $this->matches);
return 1 === preg_match('#\{([^,]+(\s*,\s*[^,]+)*)\}#', $name, $this->matches);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would rather see these kinds of things in a separate PR - it's not that they aren't obviously useful, but it's a lot of chatter that makes it much more difficult to review and merge quickly.

@tshelburne
Copy link
Collaborator

Overall, really great fixes - documentation and annotations are probably some of the biggest struggles we've had with it so far, thanks for all this.

Re: my comments about separate PRs, for these really public repos, I vastly prefer breaking things down as granularly as possible. Since it's infrequent that I have large blocks of time to review things, it's much better to have a small set of homogeneous changes than many varied changes in one PR. I like everything that you are doing, but now when you go through and make changes based on the conversation above, I have to review all 22 files all over again, which takes a larger chunk of time than I might have for a while.

@munkie
Copy link
Contributor Author

munkie commented Sep 14, 2015

OK, i've removed changes not related to docblocks.

@munkie
Copy link
Contributor Author

munkie commented Sep 19, 2015

@tshelburne I've merge master and resolved conflict, so this PR can be merged now.

@tshelburne
Copy link
Collaborator

I would rather see you rebase up to commit 607c3b9 off of master so that we don't end up with two merge commits. Make sense?

@munkie
Copy link
Contributor Author

munkie commented Sep 20, 2015

@tshelburne done

@@ -25,7 +25,7 @@ class ListName implements MethodInterface
*/
public function canBuild($name)
{
return 1 === preg_match('#\{([^,]+(\s*,\s*[^,]+)*)\}#', $name, $this->matches);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like you might have selected the wrong thing in rebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tshelburne Fixed

@tshelburne
Copy link
Collaborator

@Seldaek I'm happy with this, but it's a lot of "preference" - you good?

@theofidry
Copy link
Member

@tshelburne this could be quickly be rebased and merged :)

@munkie
Copy link
Contributor Author

munkie commented Mar 17, 2016

@theofidry @tshelburne Rebased

tshelburne added a commit that referenced this pull request Mar 21, 2016
Fix incorrect docblock var and return types
@tshelburne tshelburne merged commit 3bf8e6f into nelmio:master Mar 21, 2016
@tshelburne
Copy link
Collaborator

@munkie Thanks!

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.

3 participants