Skip to content

Commit 35625cf

Browse files
committed
Dev: Update phpstan for PHP 8.4 and regen base line, fixing a couple of errors in Options for phpstan
1 parent 7900e10 commit 35625cf

File tree

3 files changed

+3
-163
lines changed

3 files changed

+3
-163
lines changed

Editor/Options.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class Options extends Ext
114114
/**
115115
* Constructor.
116116
*
117-
* @param string $table As a string this is the database table name - see `->table()`. If given as a function, then it is passed to `->fn()` as a custom function.
117+
* @param string|callable $table As a string this is the database table name - see `->table()`. If given as a function, then it is passed to `->fn()` as a custom function.
118118
* @param string $value The database column name to use as the value for the options - see `->value()`
119119
* @param string $label The database column name to use as the label for the options - see `->label()`.
120120
*/
@@ -423,7 +423,7 @@ public function exec($db, $refresh, $search = null, $find = null)
423423
for ($j = 0; $j < count($this->_includes); ++$j) {
424424
$inc = $this->_includes[$j];
425425

426-
if (isset($rows[$i][$inc])) {
426+
if (isset($options[$i][$inc])) {
427427
$option[$inc] = $options[$i][$inc];
428428
}
429429
}

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require-dev": {
1717
"friendsofphp/php-cs-fixer": "~3.41.0",
1818
"phpstan/extension-installer": "^1.1",
19-
"phpstan/phpstan": "~1.10.47",
19+
"phpstan/phpstan": "~1.11",
2020
"phpstan/phpstan-deprecation-rules": "^1.0"
2121
},
2222
"autoload": {

phpstan-baseline.neon

-160
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ parameters:
7575
count: 1
7676
path: Database/Driver/PostgresResult.php
7777

78-
-
79-
message: "#^Method DataTables\\\\Database\\\\Query\\:\\:_where_group\\(\\) should return string but return statement is missing\\.$#"
80-
count: 1
81-
path: Database/Query.php
82-
8378
-
8479
message: "#^Method DataTables\\\\Database\\\\Query\\:\\:connect\\(\\) should return PDO but return statement is missing\\.$#"
8580
count: 1
@@ -120,16 +115,6 @@ parameters:
120115
count: 1
121116
path: Editor.php
122117

123-
-
124-
message: "#^Parameter \\#3 \\$pkey of method DataTables\\\\Editor\\:\\:_remove_table\\(\\) expects string\\|null, array\\<int, mixed\\> given\\.$#"
125-
count: 1
126-
path: Editor.php
127-
128-
-
129-
message: "#^Property DataTables\\\\Editor\\:\\:\\$_db is never written, only read\\.$#"
130-
count: 1
131-
path: Editor.php
132-
133118
-
134119
message: "#^Property DataTables\\\\Editor\\:\\:\\$_formData is never read, only written\\.$#"
135120
count: 1
@@ -140,11 +125,6 @@ parameters:
140125
count: 1
141126
path: Editor.php
142127

143-
-
144-
message: "#^Strict comparison using \\!\\=\\= between array and null will always evaluate to true\\.$#"
145-
count: 1
146-
path: Editor.php
147-
148128
-
149129
message: "#^Strict comparison using \\!\\=\\= between string and null will always evaluate to true\\.$#"
150130
count: 1
@@ -180,31 +160,6 @@ parameters:
180160
count: 1
181161
path: Editor/Field.php
182162

183-
-
184-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_getFormatter is never written, only read\\.$#"
185-
count: 1
186-
path: Editor/Field.php
187-
188-
-
189-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_getValue is never written, only read\\.$#"
190-
count: 1
191-
path: Editor/Field.php
192-
193-
-
194-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_setFormatter is never written, only read\\.$#"
195-
count: 1
196-
path: Editor/Field.php
197-
198-
-
199-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_setValue is never written, only read\\.$#"
200-
count: 1
201-
path: Editor/Field.php
202-
203-
-
204-
message: "#^Property DataTables\\\\Editor\\\\Field\\:\\:\\$_upload is never written, only read\\.$#"
205-
count: 1
206-
path: Editor/Field.php
207-
208163
-
209164
message: "#^Strict comparison using \\=\\=\\= between \\(callable\\(mixed\\)\\: string\\)\\|false and true will always evaluate to false\\.$#"
210165
count: 1
@@ -295,26 +250,6 @@ parameters:
295250
count: 1
296251
path: Editor/Join.php
297252

298-
-
299-
message: "#^Parameter \\#3 \\$data of method DataTables\\\\Editor\\\\Join\\:\\:_validateFields\\(\\) expects array\\<string\\>, string given\\.$#"
300-
count: 1
301-
path: Editor/Join.php
302-
303-
-
304-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_customOrder is never written, only read\\.$#"
305-
count: 1
306-
path: Editor/Join.php
307-
308-
-
309-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_table is never written, only read\\.$#"
310-
count: 1
311-
path: Editor/Join.php
312-
313-
-
314-
message: "#^Property DataTables\\\\Editor\\\\Join\\:\\:\\$_type is never written, only read\\.$#"
315-
count: 1
316-
path: Editor/Join.php
317-
318253
-
319254
message: "#^Variable \\$readField might not be defined\\.$#"
320255
count: 2
@@ -325,41 +260,6 @@ parameters:
325260
count: 1
326261
path: Editor/Options.php
327262

328-
-
329-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_customFn is never written, only read\\.$#"
330-
count: 1
331-
path: Editor/Options.php
332-
333-
-
334-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_limit is never written, only read\\.$#"
335-
count: 1
336-
path: Editor/Options.php
337-
338-
-
339-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_renderer is never written, only read\\.$#"
340-
count: 1
341-
path: Editor/Options.php
342-
343-
-
344-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_table is never written, only read\\.$#"
345-
count: 1
346-
path: Editor/Options.php
347-
348-
-
349-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_value is never written, only read\\.$#"
350-
count: 1
351-
path: Editor/Options.php
352-
353-
-
354-
message: "#^Property DataTables\\\\Editor\\\\Options\\:\\:\\$_where is never written, only read\\.$#"
355-
count: 1
356-
path: Editor/Options.php
357-
358-
-
359-
message: "#^Cannot call method where\\(\\) on string\\.$#"
360-
count: 1
361-
path: Editor/SearchBuilderOptions.php
362-
363263
-
364264
message: "#^Method DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:_get_where\\(\\) is unused\\.$#"
365265
count: 1
@@ -370,71 +270,16 @@ parameters:
370270
count: 1
371271
path: Editor/SearchBuilderOptions.php
372272

373-
-
374-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_order is never written, only read\\.$#"
375-
count: 1
376-
path: Editor/SearchBuilderOptions.php
377-
378-
-
379-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_renderer is never written, only read\\.$#"
380-
count: 1
381-
path: Editor/SearchBuilderOptions.php
382-
383-
-
384-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_table is never written, only read\\.$#"
385-
count: 1
386-
path: Editor/SearchBuilderOptions.php
387-
388-
-
389-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_value is never written, only read\\.$#"
390-
count: 1
391-
path: Editor/SearchBuilderOptions.php
392-
393-
-
394-
message: "#^Property DataTables\\\\Editor\\\\SearchBuilderOptions\\:\\:\\$_where is never written, only read\\.$#"
395-
count: 1
396-
path: Editor/SearchBuilderOptions.php
397-
398273
-
399274
message: "#^Strict comparison using \\=\\=\\= between 'array' and 'array' will always evaluate to true\\.$#"
400275
count: 1
401276
path: Editor/SearchBuilderOptions.php
402277

403-
-
404-
message: "#^Cannot call method where\\(\\) on string\\.$#"
405-
count: 1
406-
path: Editor/SearchPaneOptions.php
407-
408278
-
409279
message: "#^Method DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:_get_where\\(\\) is unused\\.$#"
410280
count: 1
411281
path: Editor/SearchPaneOptions.php
412282

413-
-
414-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_order is never written, only read\\.$#"
415-
count: 1
416-
path: Editor/SearchPaneOptions.php
417-
418-
-
419-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_renderer is never written, only read\\.$#"
420-
count: 1
421-
path: Editor/SearchPaneOptions.php
422-
423-
-
424-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_table is never written, only read\\.$#"
425-
count: 1
426-
path: Editor/SearchPaneOptions.php
427-
428-
-
429-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_value is never written, only read\\.$#"
430-
count: 1
431-
path: Editor/SearchPaneOptions.php
432-
433-
-
434-
message: "#^Property DataTables\\\\Editor\\\\SearchPaneOptions\\:\\:\\$_where is never written, only read\\.$#"
435-
count: 1
436-
path: Editor/SearchPaneOptions.php
437-
438283
-
439284
message: "#^Strict comparison using \\=\\=\\= between 'array' and 'array' will always evaluate to true\\.$#"
440285
count: 1
@@ -455,11 +300,6 @@ parameters:
455300
count: 1
456301
path: Editor/Upload.php
457302

458-
-
459-
message: "#^Method DataTables\\\\Editor\\\\Upload\\:\\:data\\(\\) should return array but returns null\\.$#"
460-
count: 1
461-
path: Editor/Upload.php
462-
463303
-
464304
message: "#^Method DataTables\\\\Editor\\\\Upload\\:\\:exec\\(\\) should return int but returns false\\.$#"
465305
count: 4

0 commit comments

Comments
 (0)