fix: number_format(): Passing null to parameter #1 ($num) of type float is deprecated

Fixes #5535
This commit is contained in:
kenjis 2022-01-04 13:56:04 +09:00
parent 6b2816c7fe
commit e51a1d9af0
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 12 additions and 2 deletions

View File

@ -258,14 +258,14 @@ abstract class BaseConnection implements ConnectionInterface
*
* @var float
*/
protected $connectTime;
protected $connectTime = 0.0;
/**
* How long it took to establish connection.
*
* @var float
*/
protected $connectDuration;
protected $connectDuration = 0.0;
/**
* If true, no queries will actually be

View File

@ -123,6 +123,16 @@ final class BaseConnectionTest extends CIUnitTestCase
$this->assertGreaterThan(0.0, $db->getConnectDuration());
}
/**
* @see https://github.com/codeigniter4/CodeIgniter4/issues/5535
*/
public function testStoresConnectionTimingsNotConnected()
{
$db = new MockConnection($this->options);
$this->assertSame('0.000000', $db->getConnectDuration());
}
public function testMagicIssetTrue()
{
$db = new MockConnection($this->options);