Skip to content

Commit bbd1cdd

Browse files
thirschthePanz
authored andcommitted
PHP 8.4 > Implicitly marking parameter as nullable is deprecated
1 parent 1fcab9a commit bbd1cdd

File tree

13 files changed

+35
-34
lines changed

13 files changed

+35
-34
lines changed

lib/Doctrine/Cli.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ class Doctrine_Cli
7171
/**
7272
* __construct
7373
*
74-
* @param array [$config=array()]
75-
* @param object|null [$formatter=null] Doctrine_Cli_Formatter
74+
* @param array $config
75+
* @param Doctrine_Cli_Formatter|null $formatter
7676
*/
77-
public function __construct(array $config = array(), Doctrine_Cli_Formatter $formatter = null)
77+
public function __construct(array $config = array(), ?Doctrine_Cli_Formatter $formatter = null)
7878
{
7979
$this->setConfig($config);
8080
$this->setFormatter($formatter ? $formatter : new Doctrine_Cli_AnsiColorFormatter());

lib/Doctrine/Collection.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -924,10 +924,10 @@ protected function compareRecords($a, $b)
924924
* Saves all records of this collection and processes the
925925
* difference of the last snapshot and the current data
926926
*
927-
* @param Doctrine_Connection $conn optional connection parameter
927+
* @param Doctrine_Connection|null $conn optional connection parameter
928928
* @return Doctrine_Collection
929929
*/
930-
public function save(Doctrine_Connection $conn = null, $processDiff = true)
930+
public function save(?Doctrine_Connection $conn = null, $processDiff = true)
931931
{
932932
if ($conn == null) {
933933
$conn = $this->_table->getConnection();
@@ -959,10 +959,10 @@ public function save(Doctrine_Connection $conn = null, $processDiff = true)
959959
* Replaces all records of this collection and processes the
960960
* difference of the last snapshot and the current data
961961
*
962-
* @param Doctrine_Connection $conn optional connection parameter
962+
* @param Doctrine_Connection|null $conn optional connection parameter
963963
* @return Doctrine_Collection
964964
*/
965-
public function replace(Doctrine_Connection $conn = null, $processDiff = true)
965+
public function replace(?Doctrine_Connection $conn = null, $processDiff = true)
966966
{
967967
if ($conn == null) {
968968
$conn = $this->_table->getConnection();
@@ -995,7 +995,7 @@ public function replace(Doctrine_Connection $conn = null, $processDiff = true)
995995
*
996996
* @return Doctrine_Collection
997997
*/
998-
public function delete(Doctrine_Connection $conn = null, $clearColl = true)
998+
public function delete(?Doctrine_Connection $conn = null, $clearColl = true)
999999
{
10001000
if ($conn == null) {
10011001
$conn = $this->_table->getConnection();

lib/Doctrine/Connection/Mssql.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ public function quoteIdentifier($identifier, $checkOption = false)
108108
* @param mixed $limit
109109
* @param mixed $offset
110110
* @param boolean $isSubQuery
111-
* @param Doctrine_Query $queryOrigin
111+
* @param Doctrine_Query|null $queryOrigin
112112
* @link https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php#L607
113113
* @link http://www.toosweettobesour.com/2010/09/16/doctrine-1-2-mssql-alternative-limitpaging/
114114
* @return string
115115
*/
116-
public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false, $isSubQuery = false, Doctrine_Query $queryOrigin = null)
116+
public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false, $isSubQuery = false, ?Doctrine_Query $queryOrigin = null)
117117
{
118118
if ($limit === false || !($limit > 0)) {
119119
return $query;

lib/Doctrine/Query.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2174,9 +2174,9 @@ public function query($query, $params = array(), $hydrationMode = null)
21742174
/**
21752175
* Copies a Doctrine_Query object.
21762176
*
2177-
* @return Doctrine_Query Copy of the Doctrine_Query instance.
2177+
* @return Doctrine_Query|null Copy of the Doctrine_Query instance.
21782178
*/
2179-
public function copy(Doctrine_Query $query = null)
2179+
public function copy(?Doctrine_Query $query = null)
21802180
{
21812181
if ( ! $query) {
21822182
$query = $this;

lib/Doctrine/Query/Abstract.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -292,14 +292,15 @@ abstract class Doctrine_Query_Abstract
292292
/**
293293
* Constructor.
294294
*
295-
* @param Doctrine_Connection $connection The connection object the query will use.
296-
* @param Doctrine_Hydrator_Abstract $hydrator The hydrator that will be used for generating result sets.
295+
* @param Doctrine_Connection|null $connection The connection object the query will use.
296+
* @param Doctrine_Hydrator_Abstract|null $hydrator The hydrator that will be used for generating result sets.
297297
*
298298
* @throws Doctrine_Connection_Exception
299299
*/
300-
public function __construct(Doctrine_Connection $connection = null,
301-
Doctrine_Hydrator_Abstract $hydrator = null)
302-
{
300+
public function __construct(
301+
?Doctrine_Connection $connection = null,
302+
?Doctrine_Hydrator_Abstract $hydrator = null
303+
) {
303304
if ($connection === null) {
304305
$connection = Doctrine_Manager::getInstance()->getCurrentConnection();
305306
} else {

lib/Doctrine/Query/Part.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ abstract class Doctrine_Query_Part
4242
/**
4343
* @param Doctrine_Query $query the query object associated with this parser
4444
*/
45-
public function __construct($query, Doctrine_Query_Tokenizer $tokenizer = null)
45+
public function __construct($query, ?Doctrine_Query_Tokenizer $tokenizer = null)
4646
{
4747
$this->query = $query;
4848

lib/Doctrine/RawSql.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
4646
/**
4747
* Constructor.
4848
*
49-
* @param Doctrine_Connection The connection object the query will use.
50-
* @param Doctrine_Hydrator_Abstract The hydrator that will be used for generating result sets.
49+
* @param Doctrine_Connection|null $connection The connection object the query will use.
50+
* @param Doctrine_Hydrator_Abstract|null $hydrator The hydrator that will be used for generating result sets.
5151
*/
52-
function __construct(Doctrine_Connection $connection = null, Doctrine_Hydrator_Abstract $hydrator = null) {
52+
function __construct(?Doctrine_Connection $connection = null, ?Doctrine_Hydrator_Abstract $hydrator = null) {
5353
parent::__construct($connection, $hydrator);
5454

5555
// Fix #1472. It's alid to disable QueryCache since there's no DQL for RawSql.

lib/Doctrine/Record.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,7 @@ public function resetPendingUnlinks()
17291729
* @throws Exception if record is not valid and validation is active
17301730
* @return void
17311731
*/
1732-
public function save(Doctrine_Connection $conn = null)
1732+
public function save(?Doctrine_Connection $conn = null)
17331733
{
17341734
if ($conn === null) {
17351735
$conn = $this->_table->getConnection();
@@ -1746,7 +1746,7 @@ public function save(Doctrine_Connection $conn = null)
17461746
* @param Doctrine_Connection $conn optional connection parameter
17471747
* @return TRUE if the record was saved sucessfully without errors, FALSE otherwise.
17481748
*/
1749-
public function trySave(Doctrine_Connection $conn = null) {
1749+
public function trySave(?Doctrine_Connection $conn = null) {
17501750
try {
17511751
$this->save($conn);
17521752
return true;
@@ -1772,7 +1772,7 @@ public function trySave(Doctrine_Connection $conn = null) {
17721772
* @throws Doctrine_Connection_Exception if something fails at database level
17731773
* @return integer number of rows affected
17741774
*/
1775-
public function replace(Doctrine_Connection $conn = null)
1775+
public function replace(?Doctrine_Connection $conn = null)
17761776
{
17771777
if ($conn === null) {
17781778
$conn = $this->_table->getConnection();
@@ -2197,7 +2197,7 @@ public function getIterator()
21972197
*
21982198
* @return boolean true if successful
21992199
*/
2200-
public function delete(Doctrine_Connection $conn = null)
2200+
public function delete(?Doctrine_Connection $conn = null)
22012201
{
22022202
if ($conn == null) {
22032203
$conn = $this->_table->getConnection();

lib/Doctrine/Table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2066,10 +2066,10 @@ public function enumIndex($fieldName, $value)
20662066
*
20672067
* @param string $fieldName
20682068
* @param string $value
2069-
* @param Doctrine_Record $record record to consider; if it does not exists, it is created
2069+
* @param Doctrine_Record|null $record record to consider; if it does not exist, it is created
20702070
* @return Doctrine_Validator_ErrorStack $errorStack
20712071
*/
2072-
public function validateField($fieldName, $value, Doctrine_Record $record = null)
2072+
public function validateField($fieldName, $value, ?Doctrine_Record $record = null)
20732073
{
20742074
if ($record instanceof Doctrine_Record) {
20752075
$errorStack = $record->getErrorStack();
@@ -2222,7 +2222,7 @@ public function removeColumn($fieldName)
22222222
*
22232223
* @return array numeric array
22242224
*/
2225-
public function getColumnNames(array $fieldNames = null)
2225+
public function getColumnNames(?array $fieldNames = null)
22262226
{
22272227
if ($fieldNames === null) {
22282228
return array_keys($this->_columns);

lib/Doctrine/Tree/Interface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ interface Doctrine_Tree_Interface {
3535
/**
3636
* creates root node from given record or from a new record
3737
*
38-
* @param Doctrine_Record $record instance of Doctrine_Record
38+
* @param Doctrine_Record|null $record instance of Doctrine_Record
3939
*/
40-
public function createRoot(Doctrine_Record $record = null);
40+
public function createRoot(?Doctrine_Record $record = null);
4141

4242
/**
4343
* returns root node

lib/Doctrine/Tree/NestedSet.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ public function setTableDefinition()
8282
* the records id will be assigned to the root id. You must use numeric columns for the id
8383
* and root id columns.
8484
*
85-
* @param object $record instance of Doctrine_Record
85+
* @param Doctrine_Record|null $record instance of Doctrine_Record
8686
*/
87-
public function createRoot(Doctrine_Record $record = null)
87+
public function createRoot(?Doctrine_Record $record = null)
8888
{
8989
if ($this->getAttribute('hasManyRoots')) {
9090
if ( ! $record || ( ! $record->exists() && ! $record->getNode()->getRootValue())

tests/DoctrineTest/GroupTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function shouldBeRun($testCase, $filter)
5252
}
5353
return true;
5454
}
55-
public function run(DoctrineTest_Reporter $reporter = null, $filter = null)
55+
public function run(?DoctrineTest_Reporter $reporter = null, $filter = null)
5656
{
5757
set_time_limit(900);
5858

tests/DoctrineTest/UnitTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function _fail($message = "")
155155
self::$_passesAndFails['fails'][$class] = $class;
156156
}
157157

158-
public function run(DoctrineTest_Reporter $reporter = null, $filter = null)
158+
public function run(?DoctrineTest_Reporter $reporter = null, $filter = null)
159159
{
160160
foreach (get_class_methods($this) as $method) {
161161
if ($this->isTestMethod($method)) {

0 commit comments

Comments
 (0)