Skip to content

Commit fd5c156

Browse files
authored
Merge pull request #6875 from kenjis/fix-psalm-errors
chore: psalm config
2 parents cecab92 + 61fe138 commit fd5c156

File tree

4 files changed

+212
-0
lines changed

4 files changed

+212
-0
lines changed

psalm-baseline.xml

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<files psalm-version="4.30.0@d0bc6e25d89f649e4f36a534f330f8bb4643dd69">
3+
<file src="app/Config/Routes.php">
4+
<MissingFile occurrences="1">
5+
<code>require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php'</code>
6+
</MissingFile>
7+
</file>
8+
<file src="system/Cache/Handlers/MemcachedHandler.php">
9+
<UndefinedClass occurrences="3">
10+
<code>Memcache</code>
11+
<code>Memcache</code>
12+
<code>Memcache</code>
13+
</UndefinedClass>
14+
<UndefinedDocblockClass occurrences="7">
15+
<code>$this-&gt;memcached</code>
16+
<code>$this-&gt;memcached</code>
17+
<code>$this-&gt;memcached</code>
18+
<code>$this-&gt;memcached</code>
19+
<code>$this-&gt;memcached</code>
20+
<code>$this-&gt;memcached</code>
21+
<code>Memcache|Memcached</code>
22+
</UndefinedDocblockClass>
23+
</file>
24+
<file src="system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReader.php">
25+
<DuplicateArrayKey occurrences="1">
26+
<code>$routeWithoutController</code>
27+
</DuplicateArrayKey>
28+
</file>
29+
<file src="system/Commands/Utilities/Routes/ControllerMethodReader.php">
30+
<DuplicateArrayKey occurrences="2">
31+
<code>$routeWithoutController</code>
32+
<code>$routeWithoutController</code>
33+
</DuplicateArrayKey>
34+
</file>
35+
<file src="system/Database/BasePreparedQuery.php">
36+
<InaccessibleProperty occurrences="1">
37+
<code>$this-&gt;db-&gt;transStatus</code>
38+
</InaccessibleProperty>
39+
</file>
40+
<file src="system/Database/OCI8/Connection.php">
41+
<UndefinedConstant occurrences="5">
42+
<code>OCI_COMMIT_ON_SUCCESS</code>
43+
<code>OCI_COMMIT_ON_SUCCESS</code>
44+
<code>OCI_COMMIT_ON_SUCCESS</code>
45+
<code>OCI_NO_AUTO_COMMIT</code>
46+
<code>SQLT_CHR</code>
47+
</UndefinedConstant>
48+
</file>
49+
<file src="system/Database/SQLSRV/Connection.php">
50+
<UndefinedConstant occurrences="3">
51+
<code>SQLSRV_ENC_CHAR</code>
52+
<code>SQLSRV_ERR_ERRORS</code>
53+
<code>SQLSRV_ERR_ERRORS</code>
54+
</UndefinedConstant>
55+
</file>
56+
<file src="system/Database/SQLSRV/Result.php">
57+
<UndefinedConstant occurrences="30">
58+
<code>SQLSRV_FETCH_ASSOC</code>
59+
<code>SQLSRV_SQLTYPE_BIGINT</code>
60+
<code>SQLSRV_SQLTYPE_BIT</code>
61+
<code>SQLSRV_SQLTYPE_CHAR</code>
62+
<code>SQLSRV_SQLTYPE_DATE</code>
63+
<code>SQLSRV_SQLTYPE_DATETIME</code>
64+
<code>SQLSRV_SQLTYPE_DATETIME2</code>
65+
<code>SQLSRV_SQLTYPE_DATETIMEOFFSET</code>
66+
<code>SQLSRV_SQLTYPE_DECIMAL</code>
67+
<code>SQLSRV_SQLTYPE_FLOAT</code>
68+
<code>SQLSRV_SQLTYPE_IMAGE</code>
69+
<code>SQLSRV_SQLTYPE_INT</code>
70+
<code>SQLSRV_SQLTYPE_MONEY</code>
71+
<code>SQLSRV_SQLTYPE_NCHAR</code>
72+
<code>SQLSRV_SQLTYPE_NTEXT</code>
73+
<code>SQLSRV_SQLTYPE_NUMERIC</code>
74+
<code>SQLSRV_SQLTYPE_NVARCHAR</code>
75+
<code>SQLSRV_SQLTYPE_REAL</code>
76+
<code>SQLSRV_SQLTYPE_SMALLDATETIME</code>
77+
<code>SQLSRV_SQLTYPE_SMALLINT</code>
78+
<code>SQLSRV_SQLTYPE_SMALLMONEY</code>
79+
<code>SQLSRV_SQLTYPE_TEXT</code>
80+
<code>SQLSRV_SQLTYPE_TIME</code>
81+
<code>SQLSRV_SQLTYPE_TIMESTAMP</code>
82+
<code>SQLSRV_SQLTYPE_TINYINT</code>
83+
<code>SQLSRV_SQLTYPE_UDT</code>
84+
<code>SQLSRV_SQLTYPE_UNIQUEIDENTIFIER</code>
85+
<code>SQLSRV_SQLTYPE_VARBINARY</code>
86+
<code>SQLSRV_SQLTYPE_VARCHAR</code>
87+
<code>SQLSRV_SQLTYPE_XML</code>
88+
</UndefinedConstant>
89+
</file>
90+
<file src="system/Debug/Toolbar/Views/toolbar.tpl.php">
91+
<InaccessibleMethod occurrences="1">
92+
<code>renderTimeline</code>
93+
</InaccessibleMethod>
94+
<UndefinedGlobalVariable occurrences="1">
95+
<code>$config</code>
96+
</UndefinedGlobalVariable>
97+
</file>
98+
<file src="system/Email/Email.php">
99+
<LoopInvalidation occurrences="1">
100+
<code>$timestamp</code>
101+
</LoopInvalidation>
102+
</file>
103+
<file src="system/HTTP/Files/FileCollection.php">
104+
<EmptyArrayAccess occurrences="1">
105+
<code>$output[$name]</code>
106+
</EmptyArrayAccess>
107+
</file>
108+
<file src="system/Helpers/text_helper.php">
109+
<LoopInvalidation occurrences="3">
110+
<code>$count</code>
111+
<code>$count</code>
112+
<code>$count</code>
113+
</LoopInvalidation>
114+
</file>
115+
<file src="system/I18n/TimeTrait.php">
116+
<MissingImmutableAnnotation occurrences="3">
117+
<code>#[ReturnTypeWillChange]</code>
118+
<code>#[ReturnTypeWillChange]</code>
119+
<code>#[ReturnTypeWillChange]</code>
120+
</MissingImmutableAnnotation>
121+
</file>
122+
<file src="tests/_support/Config/Filters.php">
123+
<UndefinedGlobalVariable occurrences="1">
124+
<code>$filters</code>
125+
</UndefinedGlobalVariable>
126+
</file>
127+
<file src="tests/_support/Config/Routes.php">
128+
<UndefinedGlobalVariable occurrences="2">
129+
<code>$routes</code>
130+
<code>$routes</code>
131+
</UndefinedGlobalVariable>
132+
</file>
133+
<file src="tests/_support/View/Cells/addition.php">
134+
<UndefinedGlobalVariable occurrences="1">
135+
<code>$value</code>
136+
</UndefinedGlobalVariable>
137+
</file>
138+
<file src="tests/_support/View/Cells/colors.php">
139+
<InvalidScope occurrences="1">
140+
<code>$this</code>
141+
</InvalidScope>
142+
</file>
143+
<file src="tests/_support/View/Cells/greeting.php">
144+
<UndefinedGlobalVariable occurrences="2">
145+
<code>$greeting</code>
146+
<code>$name</code>
147+
</UndefinedGlobalVariable>
148+
</file>
149+
<file src="tests/_support/View/Cells/lister.php">
150+
<UndefinedGlobalVariable occurrences="1">
151+
<code>$items</code>
152+
</UndefinedGlobalVariable>
153+
</file>
154+
<file src="tests/_support/View/Cells/multiplier.php">
155+
<UndefinedGlobalVariable occurrences="1">
156+
<code>$value</code>
157+
</UndefinedGlobalVariable>
158+
</file>
159+
<file src="tests/_support/View/Cells/notice.php">
160+
<UndefinedGlobalVariable occurrences="1">
161+
<code>$message</code>
162+
</UndefinedGlobalVariable>
163+
</file>
164+
<file src="tests/system/CLI/ConsoleTest.php">
165+
<DuplicateArrayKey occurrences="1">
166+
<code>$command</code>
167+
</DuplicateArrayKey>
168+
</file>
169+
<file src="tests/system/CommonFunctionsTest.php">
170+
<UndefinedClass occurrences="2">
171+
<code>'JobModel'</code>
172+
<code>UnexsistenceClass</code>
173+
</UndefinedClass>
174+
</file>
175+
<file src="tests/system/Config/FactoriesTest.php">
176+
<UndefinedClass occurrences="1">
177+
<code>'SomeWidget'</code>
178+
</UndefinedClass>
179+
</file>
180+
<file src="tests/system/Database/BaseConnectionTest.php">
181+
<InaccessibleProperty occurrences="2">
182+
<code>$db-&gt;username</code>
183+
<code>$db-&gt;username</code>
184+
</InaccessibleProperty>
185+
</file>
186+
<file src="tests/system/Database/Live/OCI8/CallStoredProcedureTest.php">
187+
<UndefinedConstant occurrences="3">
188+
<code>OCI_ASSOC</code>
189+
<code>OCI_B_CURSOR</code>
190+
<code>OCI_RETURN_NULLS</code>
191+
</UndefinedConstant>
192+
</file>
193+
<file src="tests/system/Entity/EntityTest.php">
194+
<EmptyArrayAccess occurrences="1">
195+
<code>$current[$key]</code>
196+
</EmptyArrayAccess>
197+
</file>
198+
<file src="tests/system/HTTP/RedirectResponseTest.php">
199+
<EmptyArrayAccess occurrences="1">
200+
<code>$_SESSION['_ci_old_input']</code>
201+
</EmptyArrayAccess>
202+
</file>
203+
<file src="tests/system/Test/ControllerTestTraitTest.php">
204+
<UndefinedClass occurrences="1">
205+
<code>NeverHeardOfIt</code>
206+
</UndefinedClass>
207+
</file>
208+
</files>

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
88
autoloader="psalm_autoload.php"
99
cacheDirectory="build/psalm/"
10+
errorBaseline="psalm-baseline.xml"
1011
>
1112
<projectFiles>
1213
<directory name="app/" />

psalm_autoload.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
require_once $filePath;
2323
}
2424
}
25+
26+
chdir(__DIR__);

system/Log/Logger.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Logger implements LoggerInterface
9292
* items.
9393
*
9494
* @var array
95+
* @phpstan-var array<class-string, array<string, list<string>|string|int>>
9596
*/
9697
protected $handlerConfig = [];
9798

0 commit comments

Comments
 (0)