Skip to content

Commit fe028c2

Browse files
authored
[PHP8.4] Deprecate implicitly nullable parameter types (#304)
AppVeyor fail is unrelated
1 parent cbe7306 commit fe028c2

10 files changed

Lines changed: 9 additions & 10 deletions

Tests/DatabaseQueryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use Joomla\Database\DatabaseInterface;
1010
use Joomla\Database\DatabaseQuery;
1111
use Joomla\Database\Exception\QueryTypeAlreadyDefinedException;
12-
use Joomla\Database\ParameterType;
1312
use Joomla\Database\Exception\UnknownTypeException;
13+
use Joomla\Database\ParameterType;
1414
use PHPUnit\Framework\MockObject\MockObject;
1515
use PHPUnit\Framework\TestCase;
1616

Tests/Mysql/MysqlPreparedStatementTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Joomla\Database\DatabaseDriver;
1010
use Joomla\Database\Exception\ExecutionFailureException;
11-
use Joomla\Database\Mysqli\MysqliStatement;
1211
use Joomla\Test\DatabaseTestCase;
1312

1413
class MysqlPreparedStatementTest extends DatabaseTestCase

src/Command/ExportCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
use Joomla\Database\Exception\UnsupportedAdapterException;
1717
use Joomla\Filesystem\File;
1818
use Symfony\Component\Console\Input\InputInterface;
19+
use Symfony\Component\Console\Input\InputOption;
1920
use Symfony\Component\Console\Output\OutputInterface;
2021
use Symfony\Component\Console\Style\SymfonyStyle;
21-
use Symfony\Component\Console\Input\InputOption;
2222

2323
/**
2424
* Console command for exporting the database

src/DatabaseDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ public function getMonitor()
17211721
*
17221722
* @since 2.0.0
17231723
*/
1724-
public function setMonitor(QueryMonitorInterface $monitor = null)
1724+
public function setMonitor(?QueryMonitorInterface $monitor = null)
17251725
{
17261726
$this->monitor = $monitor;
17271727

src/DatabaseQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ abstract class DatabaseQuery implements QueryInterface
303303
*
304304
* @since 1.0
305305
*/
306-
public function __construct(DatabaseInterface $db = null)
306+
public function __construct(?DatabaseInterface $db = null)
307307
{
308308
$this->db = $db;
309309
}

src/Exception/ConnectionFailureException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ConnectionFailureException extends \RuntimeException
2525
*
2626
* @since 2.0.0
2727
*/
28-
public function __construct($message = '', $code = 0, \Exception $previous = null)
28+
public function __construct($message = '', $code = 0, ?\Exception $previous = null)
2929
{
3030
// PDO uses strings for exception codes, PHP forces numeric codes, so "force" the string code to be used
3131
parent::__construct($message, 0, $previous);

src/Exception/ExecutionFailureException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ExecutionFailureException extends \RuntimeException
3434
*
3535
* @since 1.5.0
3636
*/
37-
public function __construct($query, $message = '', $code = 0, \Exception $previous = null)
37+
public function __construct($query, $message = '', $code = 0, ?\Exception $previous = null)
3838
{
3939
// PDO uses strings for exception codes, PHP forces numeric codes, so "force" the string code to be used
4040
parent::__construct($message, 0, $previous);

src/Exception/PrepareStatementFailureException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PrepareStatementFailureException extends \RuntimeException
2525
*
2626
* @since 2.0.0
2727
*/
28-
public function __construct($message = '', $code = 0, \Exception $previous = null)
28+
public function __construct($message = '', $code = 0, ?\Exception $previous = null)
2929
{
3030
// PDO uses strings for exception codes, PHP forces numeric codes, so "force" the string code to be used
3131
parent::__construct($message, 0, $previous);

src/QueryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace Joomla\Database;
1111

1212
use Joomla\Database\Exception\QueryTypeAlreadyDefinedException;
13+
use Joomla\Database\Exception\UnknownTypeException;
1314
use Joomla\Database\Query\LimitableInterface;
1415
use Joomla\Database\Query\PreparableInterface;
15-
use Joomla\Database\Exception\UnknownTypeException;
1616

1717
/**
1818
* Joomla Framework Query Building Interface.

src/Sqlsrv/SqlsrvDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function connect()
120120
'pwd' => $this->options['password'],
121121
'CharacterSet' => 'UTF-8',
122122
'ReturnDatesAsStrings' => true,
123-
'Encrypt' => $this->options['encrypt']
123+
'Encrypt' => $this->options['encrypt'],
124124
];
125125

126126
// Attempt to connect to the server.

0 commit comments

Comments
 (0)