Skip to content

Commit

Permalink
Merge release 2.10.1 into 2.11.x (doctrine#9092)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored Oct 5, 2021
2 parents 3984f74 + f346379 commit b0381b3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/en/reference/association-mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ The following example sets up such a unidirectional one-to-many association:
// ...
/**
* Many User have Many Phonenumbers.
* Many Users have Many Phonenumbers.
* @ManyToMany(targetEntity="Phonenumber")
* @JoinTable(name="users_phonenumbers",
* joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")},
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ public function contains($dql): bool
*/
public function setFirstResult($firstResult): self
{
if ($firstResult !== null) {
$firstResult = (int) $firstResult;
}

$this->firstResult = $firstResult;
$this->_state = self::STATE_DIRTY;

Expand All @@ -675,6 +679,10 @@ public function getFirstResult(): ?int
*/
public function setMaxResults($maxResults): self
{
if ($maxResults !== null) {
$maxResults = (int) $maxResults;
}

$this->maxResults = $maxResults;
$this->_state = self::STATE_DIRTY;

Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,10 @@ static function (Parameter $parameter) use ($key): bool {
*/
public function setFirstResult($firstResult)
{
if ($firstResult !== null) {
$firstResult = (int) $firstResult;
}

$this->_firstResult = $firstResult;

return $this;
Expand All @@ -652,6 +656,10 @@ public function getFirstResult()
*/
public function setMaxResults($maxResults)
{
if ($maxResults !== null) {
$maxResults = (int) $maxResults;
}

$this->_maxResults = $maxResults;

return $this;
Expand Down
7 changes: 7 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@
<file name="lib/Doctrine/ORM/Mapping/Driver/AttributeReader.php"/>
</errorLevel>
</NullArgument>
<RedundantCastGivenDocblockType>
<errorLevel type="suppress">
<!-- Can be removed once the "getMaxResults" methods of those classes have native parameter types -->
<file name="lib/Doctrine/ORM/Query.php"/>
<file name="lib/Doctrine/ORM/QueryBuilder.php"/>
</errorLevel>
</RedundantCastGivenDocblockType>
<TypeDoesNotContainType>
<errorLevel type="suppress">
<file name="lib/Doctrine/ORM/Internal/SQLResultCasing.php"/>
Expand Down

0 comments on commit b0381b3

Please sign in to comment.