Skip to content

Commit 924407f

Browse files
authored
Merge pull request #8519 from kenjis/fix-phpdoc-ConnectionInterface
docs: add/update PHPDocs for DB connetion
2 parents af5d5df + 1ed7245 commit 924407f

File tree

4 files changed

+59
-38
lines changed

4 files changed

+59
-38
lines changed

.php-cs-fixer.dist.php

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,35 @@
4343
__DIR__ . '/spark',
4444
]);
4545

46-
$overrides = [];
46+
$overrides = [
47+
'phpdoc_no_alias_tag' => [
48+
'replacements' => [
49+
'type' => 'var',
50+
'link' => 'see',
51+
],
52+
],
53+
'phpdoc_align' => [
54+
'align' => 'vertical',
55+
'spacing' => 1,
56+
'tags' => [
57+
'method',
58+
'param',
59+
'phpstan-assert',
60+
'phpstan-assert-if-true',
61+
'phpstan-assert-if-false',
62+
'phpstan-param',
63+
'phpstan-property',
64+
'phpstan-return',
65+
'property',
66+
'property-read',
67+
'property-write',
68+
'return',
69+
'throws',
70+
'type',
71+
'var',
72+
],
73+
],
74+
];
4775

4876
$options = [
4977
'cacheFile' => 'build/.php-cs-fixer.cache',

phpstan-baseline.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,16 +1026,6 @@
10261026
'count' => 1,
10271027
'path' => __DIR__ . '/system/Database/Config.php',
10281028
];
1029-
$ignoreErrors[] = [
1030-
'message' => '#^Access to an undefined property CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:\\$DBDriver\\.$#',
1031-
'count' => 2,
1032-
'path' => __DIR__ . '/system/Database/Database.php',
1033-
];
1034-
$ignoreErrors[] = [
1035-
'message' => '#^Access to an undefined property CodeIgniter\\\\Database\\\\ConnectionInterface\\:\\:\\$connID\\.$#',
1036-
'count' => 2,
1037-
'path' => __DIR__ . '/system/Database/Database.php',
1038-
];
10391029
$ignoreErrors[] = [
10401030
'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#',
10411031
'count' => 2,

system/Database/BaseConnection.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@
1818
use Throwable;
1919

2020
/**
21-
* @property array $aliasedTables
22-
* @property string $charset
23-
* @property bool $compress
24-
* @property float $connectDuration
25-
* @property float $connectTime
26-
* @property string $database
27-
* @property string $DBCollat
28-
* @property bool $DBDebug
29-
* @property string $DBDriver
30-
* @property string $DBPrefix
31-
* @property string $DSN
32-
* @property array|bool $encrypt
33-
* @property array $failover
34-
* @property string $hostname
35-
* @property Query $lastQuery
36-
* @property string $password
37-
* @property bool $pConnect
38-
* @property int|string $port
39-
* @property bool $pretend
40-
* @property string $queryClass
41-
* @property array $reservedIdentifiers
42-
* @property bool $strictOn
43-
* @property string $subdriver
44-
* @property string $swapPre
45-
* @property int $transDepth
46-
* @property bool $transFailure
47-
* @property bool $transStatus
21+
* @property-read array $aliasedTables
22+
* @property-read string $charset
23+
* @property-read bool $compress
24+
* @property-read float $connectDuration
25+
* @property-read float $connectTime
26+
* @property-read string $database
27+
* @property-read string $DBCollat
28+
* @property-read bool $DBDebug
29+
* @property-read string $DBDriver
30+
* @property-read string $DBPrefix
31+
* @property-read string $DSN
32+
* @property-read array|bool $encrypt
33+
* @property-read array $failover
34+
* @property-read string $hostname
35+
* @property-read Query $lastQuery
36+
* @property-read string $password
37+
* @property-read bool $pConnect
38+
* @property-read int|string $port
39+
* @property-read bool $pretend
40+
* @property-read string $queryClass
41+
* @property-read array $reservedIdentifiers
42+
* @property-read bool $strictOn
43+
* @property-read string $subdriver
44+
* @property-read string $swapPre
45+
* @property-read int $transDepth
46+
* @property-read bool $transFailure
47+
* @property-read bool $transStatus
4848
*
4949
* @template TConnection
5050
* @template TResult

system/Database/ConnectionInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
/**
1515
* @template TConnection
1616
* @template TResult
17+
*
18+
* @property false|object|resource $connID
19+
* @property-read string $DBDriver
1720
*/
1821
interface ConnectionInterface
1922
{

0 commit comments

Comments
 (0)