Skip to content
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
5 changes: 5 additions & 0 deletions system/Database/OCI8/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class Connection extends BaseConnection
'rownum',
];

/**
* @var array<string, string>
*/
protected $validDSNs = [
// TNS
'tns' => '/^\(DESCRIPTION=(\(.+\)){2,}\)$/',
Expand All @@ -79,6 +82,8 @@ class Connection extends BaseConnection
*
* Used by storedProcedure() to prevent execute() from
* re-setting the statement ID.
*
* @var bool
*/
protected $resetStmtId = true;

Expand Down
15 changes: 15 additions & 0 deletions system/Database/Postgre/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,24 @@ class Connection extends BaseConnection
*/
public $escapeChar = '"';

/**
* @var string|null
*/
protected $connect_timeout;

/**
* @var string|null
*/
protected $options;

/**
* @var string|null
*/
protected $sslmode;

/**
* @var string|null
*/
protected $service;

/**
Expand Down
5 changes: 4 additions & 1 deletion tests/system/Config/FactoriesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public function testUsesConfigOptions(): void
{
// Simulate having a $widgets property in App\Config\Factory
$config = new class () extends Factory {
public $widgets = ['bar' => 'bam'];
/**
* @var array<string, string>
*/
public array $widgets = ['bar' => 'bam'];
};
Factories::injectMock('config', Factory::class, $config);

Expand Down
8 changes: 6 additions & 2 deletions tests/system/Config/fixtures/RegistrarConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@

class RegistrarConfig extends BaseConfig
{
public $foo = 'bar';
public $bar = [
public string $foo = 'bar';

/**
* @var list<string>
*/
public array $bar = [
'baz',
];
}
74 changes: 46 additions & 28 deletions tests/system/Config/fixtures/SimpleConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,63 @@

class SimpleConfig extends BaseConfig
{
public $QZERO;
public $QZEROSTR;
public $QEMPTYSTR;
public $QFALSE;
public $first = 'foo';
public $second = 'bar';
public $FOO;
public $onedeep;
public $default = [
public ?string $QZERO = null;
public ?string $QZEROSTR = null;
public ?string $QEMPTYSTR = null;
public bool|string|null $QFALSE = null;
public string $first = 'foo';
public string $second = 'bar';
public ?string $FOO = null;
public ?string $onedeep = null;

/**
* @var array<string, string|null>
*/
public array $default = [
'name' => null,
];
public $simple = [

/**
* @var array<string, string|null>
*/
public array $simple = [
'name' => null,
];

// properties for environment override testing
public $alpha = 'one';
public $bravo = 'two';
public $charlie = 'three';
public $delta = 'four';
public $echo = '';
public $foxtrot = 'false';
public $fruit = 'pineapple';
public $dessert = '';
public $golf = 18;
public $crew = [
public string $alpha = 'one';
public string $bravo = 'two';
public string $charlie = 'three';
public string $delta = 'four';
public string $echo = '';
public bool|string $foxtrot = 'false';
public string $fruit = 'pineapple';
public string $dessert = '';
public int $golf = 18;

/**
* @var array<string, bool|string>
*/
public array $crew = [
'captain' => 'Kirk',
'science' => 'Spock',
'doctor' => 'Bones',
'comms' => 'Uhuru',
];
public $shortie;
public $longie;
public $onedeep_value;
public $one_deep = [

public ?string $shortie = null;
public ?string $longie = null;
public ?string $onedeep_value = null;

/**
* @var array<string, string|null>
*/
public array $one_deep = [
'under_deep' => null,
];
public $float = 12.34;
public $int = 1234;
public $password = 'secret';
public ?int $size = null;

public float $float = 12.34;
public int $int = 1234;
public string $password = 'secret';
public ?int $size = null;
}
17 changes: 14 additions & 3 deletions tests/system/Database/Live/ConnectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,20 @@ final class ConnectTest extends CIUnitTestCase
{
use DatabaseTestTrait;

private $group1;
private $group2;
private $tests;
/**
* @var array<string, mixed>
*/
private array $group1 = [];

/**
* @var array<string, mixed>
*/
private array $group2 = [];

/**
* @var array<string, mixed>
*/
private array $tests = [];

protected function setUp(): void
{
Expand Down
14 changes: 7 additions & 7 deletions tests/system/Database/Live/GetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ public function testGetRowWithReturnType(): void
public function testGetRowWithCustomReturnType(): void
{
$testClass = new class () {
public $id;
public $name;
public $email;
public $country;
public $created_at;
public $updated_at;
public $deleted_at;
public mixed $id = null;
public mixed $name = null;
public mixed $email = null;
public mixed $country = null;
public mixed $created_at = null;
public mixed $updated_at = null;
public mixed $deleted_at = null;
};

$user = $this->db->table('user')->get()->getRow(0, $testClass::class);
Expand Down
6 changes: 5 additions & 1 deletion tests/system/Database/Live/MySQLi/NumberNativeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ final class NumberNativeTest extends CIUnitTestCase
{
use DatabaseTestTrait;

private $tests;
/**
* @var array<string, mixed>
*/
private array $tests = [];

protected $refresh = true;
protected $seed = CITestSeeder::class;

Expand Down
3 changes: 1 addition & 2 deletions utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1527 errors
# total 1480 errors

includes:
- argument.type.neon
Expand All @@ -12,7 +12,6 @@ includes:
- method.notFound.neon
- missingType.iterableValue.neon
- missingType.parameter.neon
- missingType.property.neon
- nullCoalesce.property.neon
- property.defaultValue.neon
- property.nonObject.neon
Expand Down
Loading
Loading