-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
phpstan-dba: improve coverage #1232
Changes from all commits
407e26d
006ff31
1fba477
969f06c
f140a56
7216b8f
ef0f3ee
2f8c458
148583a
52c7a24
051ca32
c3a997e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,6 +469,9 @@ public function getDependents(string $name, int $offset = 0, int $limit = 15, st | |
return $this->getEntityManager()->getConnection()->fetchAllAssociative($sql, $args); | ||
} | ||
|
||
/** | ||
* @param string $name | ||
*/ | ||
public function getSuggestCount($name): int | ||
{ | ||
$sql = 'SELECT COUNT(*) count FROM suggester WHERE packageName = :name'; | ||
|
@@ -477,6 +480,11 @@ public function getSuggestCount($name): int | |
return (int) $this->getEntityManager()->getConnection()->fetchOne($sql, $args); | ||
} | ||
|
||
/** | ||
* @param string $name | ||
* @param int $offset | ||
* @param int $limit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could use actual parameter types rather than phpdoc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes please go wild with PHP 8 syntax in this repo 😄 |
||
*/ | ||
public function getSuggests($name, $offset = 0, $limit = 15) | ||
{ | ||
$sql = 'SELECT p.id, p.name, p.description, p.language, p.abandoned, p.replacementPackage | ||
|
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.
Interesting failure here, it seems to pick up the conditional d.total usage but not the join declaring it? TBH this is quite messy code and I don't expect perfect handling here, but it should at least ignore it rather than error I guess.
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.
will investigate in staabm/phpstan-dba#188
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.
Cool, no rush, glad to provide this repo as playground :) I have another project with hundreds of pure SQL queries I could run the extension on once it matured a bit, but sadly it's private.