-
Notifications
You must be signed in to change notification settings - Fork 397
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
fixed input type of findBy hints #1912
fixed input type of findBy hints #1912
Conversation
Codecov ReportBase: 87.64% // Head: 87.62% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1912 +/- ##
============================================
- Coverage 87.64% 87.62% -0.02%
+ Complexity 7829 7822 -7
============================================
Files 227 227
Lines 21183 21135 -48
============================================
- Hits 18565 18519 -46
+ Misses 2618 2616 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Docbloc is now generated like this (for BookReaderQuery from the test suite): /**
* Base class that represents a query for the book_reader table.
*
* @method ChildBookReaderQuery orderById($order = Criteria::ASC) Order by the id column
* @method ChildBookReaderQuery orderByName($order = Criteria::ASC) Order by the name column
*
* @method ChildBookReaderQuery groupById() Group by the id column';
* @method ChildBookReaderQuery groupByName() Group by the name column';
*
* @method ChildBookReaderQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method ChildBookReaderQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
* @method ChildBookReaderQuery innerJoin($relation) Adds a INNER JOIN clause to the query
*
* @method ChildBookReaderQuery leftJoinWith($relation) Adds a LEFT JOIN clause and with to the query
* @method ChildBookReaderQuery rightJoinWith($relation) Adds a RIGHT JOIN clause and with to the query
* @method ChildBookReaderQuery innerJoinWith($relation) Adds a INNER JOIN clause and with to the query
*
* @method ChildBookReaderQuery leftJoinBookOpinion($relationAlias = null) Adds a LEFT JOIN clause to the query using the BookOpinion relation
* @method ChildBookReaderQuery rightJoinBookOpinion($relationAlias = null) Adds a RIGHT JOIN clause to the query using the BookOpinion relation
* @method ChildBookReaderQuery innerJoinBookOpinion($relationAlias = null) Adds a INNER JOIN clause to the query using the BookOpinion relation
*
* @method ChildBookReaderQuery joinWithBookOpinion($joinType = Criteria::INNER_JOIN) Adds a join clause and with to the query using the ' . $relationName . " relation
*
* @method ChildBookReaderQuery leftJoinWithBookOpinion() Adds a LEFT JOIN clause and with to the query using the BookOpinion relation
* @method ChildBookReaderQuery rightJoinWithBookOpinion() Adds a RIGHT JOIN clause and with to the query using the BookOpinion relation
* @method ChildBookReaderQuery innerJoinWithBookOpinion() Adds a INNER JOIN clause and with to the query using the BookOpinion relation
*
* @method ChildBookReaderQuery leftJoinReaderFavorite($relationAlias = null) Adds a LEFT JOIN clause to the query using the ReaderFavorite relation
* @method ChildBookReaderQuery rightJoinReaderFavorite($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ReaderFavorite relation
* @method ChildBookReaderQuery innerJoinReaderFavorite($relationAlias = null) Adds a INNER JOIN clause to the query using the ReaderFavorite relation
*
* @method ChildBookReaderQuery joinWithReaderFavorite($joinType = Criteria::INNER_JOIN) Adds a join clause and with to the query using the ' . $relationName . " relation
*
* @method ChildBookReaderQuery leftJoinWithReaderFavorite() Adds a LEFT JOIN clause and with to the query using the ReaderFavorite relation
* @method ChildBookReaderQuery rightJoinWithReaderFavorite() Adds a RIGHT JOIN clause and with to the query using the ReaderFavorite relation
* @method ChildBookReaderQuery innerJoinWithReaderFavorite() Adds a INNER JOIN clause and with to the query using the ReaderFavorite relation
*
* @method \Propel\Tests\Bookstore\BookOpinionQuery|\Propel\Tests\Bookstore\ReaderFavoriteQuery endUse() Finalizes a secondary criteria and merges it with its primary Criteria
*
* @method ChildBookReader|null findOne(?ConnectionInterface $con = null) Return the first ChildBookReader matching the query
* @method ChildBookReader findOneOrCreate(?ConnectionInterface $con = null) Return the first ChildBookReader matching the query, or a new ChildBookReader object populated from the query conditions when no match is found
*
* @method ChildBookReader|null findOneById(int $id) Return the first ChildBookReader filtered by the id column
* @method ChildBookReader|null findOneByName(string $name) Return the first ChildBookReader filtered by the name column
*
* @method ChildBookReader requirePk($key, ?ConnectionInterface $con = null) Return the ChildBookReader by primary key and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
* @method ChildBookReader requireOne(?ConnectionInterface $con = null) Return the first ChildBookReader matching the query and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
*
* @method ChildBookReader requireOneById(int $id) Return the first ChildBookReader filtered by the $name column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
* @method ChildBookReader requireOneByName(string $name) Return the first ChildBookReader filtered by the $name column and throws \Propel\Runtime\Exception\EntityNotFoundException when not found
*
* @method ChildBookReader[]|Collection find(?ConnectionInterface $con = null) Return ChildBookReader objects based on current ModelCriteria
* @psalm-method Collection&\Traversable<ChildBookReader> find(?ConnectionInterface $con = null) Return ChildBookReader objects based on current ModelCriteria
*
* @method ChildBookReader[]|Collection findById(int|array<int> $id) Return ChildBookReader objects filtered by the id column
* @psalm-method Collection&\Traversable<ChildBookReader> findById(int|array<int> $id) Return ChildBookReader objects filtered by the id column
* @method ChildBookReader[]|Collection findByName(string|array<string> $name) Return ChildBookReader objects filtered by the name column
* @psalm-method Collection&\Traversable<ChildBookReader> findByName(string|array<string> $name) Return ChildBookReader objects filtered by the name column
*
* @method ChildBookReader[]|\Propel\Runtime\Util\PropelModelPager paginate($page = 1, $maxPerPage = 10, ?ConnectionInterface $con = null) Issue a SELECT query based on the current ModelCriteria and uses a page and a maximum number of results per page to compute an offset and a limit
* @psalm-method \Propel\Runtime\Util\PropelModelPager&\Traversable<ChildBookReader> paginate($page = 1, $maxPerPage = 10, ?ConnectionInterface $con = null) Issue a SELECT query based on the current ModelCriteria and uses a page and a maximum number of results per page to compute an offset and a limit
*/
abstract class BookReaderQuery extends ModelCriteria
{ |
5e40c21
to
1dcba33
Compare
1dcba33
to
a1c385d
Compare
Currently type hints for the
findBy*($value)
methods of query classes have the input type set to the column type. So if an id column uses integers, the findById method is said to expect an int as input:However, the findBy methods also deal with arrays, you can do
BookQuery::create()->findById([1,2,3])
, which will correctly generate an IN query (i.e.SELECT * from Book where id IN (1,2,3)
). This is quite useful.So I think the input type should be
T|array<T>
in@method
and@psalm-method
:I also moved the docblock into its own template file.