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

A few more php 8.1 things #92

Merged
merged 3 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Doctrine/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public function enumIndex($field, $value)
*
* @return integer
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->_definition);
Expand All @@ -156,6 +157,7 @@ public function count()
*
* @return ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->_definition);
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Export/Reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function pop()
return array_pop($this->messages);
}

#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->messages);
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Hydrator/RecordDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function flush()
$coll->takeSnapshot();
}
$this->_initializedRelations = null;
$this->_collections = null;
$this->_collections = array();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not really related to 8.1. Flushing twice caused a warning due to the $_collection being set to null.

$this->_tables = null;
}
}
2 changes: 2 additions & 0 deletions lib/Doctrine/Locator.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public function locate($name)
* @see Countable interface
* @return integer the number of resources
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->_resources);
Expand All @@ -191,6 +192,7 @@ public function count()
* @return ArrayIterator an iterator for iterating through
* all bound resources
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->_resources);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ public function findByDql($dql, $params = array(), $hydrationMode = null)
* Find records basing on a field.
*
* @param string $column field for the WHERE clause
* @param string $value prepared statement parameter
* @param string|array $value prepared statement parameter
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two are not related to 8.1 as well, but it's nice in editors with code assist to know the correct types.

* @param int $hydrationMode Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD
* @return Doctrine_Collection|array
*/
Expand All @@ -1719,7 +1719,7 @@ public function findBy($fieldName, $value, $hydrationMode = null)
* Finds the first record that satisfy the clause.
*
* @param string $column field for the WHERE clause
* @param string $value prepared statement parameter
* @param string|array $value prepared statement parameter
* @param int $hydrationMode Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD
* @return Doctrine_Record
*/
Expand Down
1 change: 1 addition & 0 deletions lib/Doctrine/Table/Repository/None.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public function get($oid)
*
* @return integer the number of records this registry has
*/
#[\ReturnTypeWillChange]
public function count()
{
return 0;
Expand Down