-
Notifications
You must be signed in to change notification settings - Fork 179
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
Fix some phan problems #3533
Conversation
This randomly fixes some classes of issues detected by phan
* | ||
* @return string the page content | ||
* @return ResponseInterface The response with the the page content |
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 the
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.
thanks, fixed
*/ | ||
public function __construct( | ||
IDatabaseProvider $databaseProvider = null |
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.
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?
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.
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
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 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..)
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.
gotcha 👍
This randomly fixes some classes of issues detected by phan and updates the phan config to ensure no regressions.