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 some phan problems #3533

Merged
merged 2 commits into from
Mar 5, 2018
Merged

Fix some phan problems #3533

merged 2 commits into from
Mar 5, 2018

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Mar 5, 2018

This randomly fixes some classes of issues detected by phan and updates the phan config to ensure no regressions.

This randomly fixes some classes of issues detected by phan
*
* @return string the page content
* @return ResponseInterface The response with the the page content
Copy link
Contributor

Choose a reason for hiding this comment

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

the the

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, fixed

*/
public function __construct(
IDatabaseProvider $databaseProvider = null
Copy link
Contributor

Choose a reason for hiding this comment

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

If the constructor is called with a null databaseProvider, why is $this->_databaseProvider not set to new DefaultDatabaseProvider() here instead of in the get function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You'd have to ask the person who wrote the code, I just fixed the bug that phan found. null isn't a valid value, because it's defined as taking an IDatabaseProvider in the signature, so it would crash with a runtime error if you called it that way anyways

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(the other problem that phan detected is that the doc comment said it was a "mixed" param type, but the actual signature in PHP was declared as IDatabaseProvider..)

Copy link
Contributor

Choose a reason for hiding this comment

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

gotcha 👍

@driusan driusan merged commit 7cbca9b into aces:major Mar 5, 2018
@ridz1208 ridz1208 added this to the 20.0 milestone Apr 17, 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.

4 participants