Skip to content

Commit 1d34b21

Browse files
author
Emmanuel Campait
committed
Fix CI, static analysis, and documentation updates
1 parent aec970e commit 1d34b21

12 files changed

Lines changed: 152 additions & 18 deletions

phpstan.neon.dist

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
parameters:
2-
tmpDir: build/phpstan-tmp
2+
tmpDir: build/phpstan-cache
33
level: 6
44
paths:
55
- src/
@@ -8,6 +8,41 @@ parameters:
88
- tests/bootstrap.php
99
excludePaths:
1010
- tests/_support/*
11+
- src/Cells/accordion.php
12+
- src/Cells/alert.php
13+
- src/Cells/badge.php
14+
- src/Cells/breadcrumb.php
15+
- src/Cells/button.php
16+
- src/Cells/button_group.php
17+
- src/Cells/button_toolbar.php
18+
- src/Cells/card.php
19+
- src/Cells/carousel.php
20+
- src/Cells/close_button.php
21+
- src/Cells/collapse.php
22+
- src/Cells/description_list.php
23+
- src/Cells/dropdown.php
24+
- src/Cells/empty_state.php
25+
- src/Cells/figure.php
26+
- src/Cells/form.php
27+
- src/Cells/image.php
28+
- src/Cells/input_group.php
29+
- src/Cells/list_group.php
30+
- src/Cells/modal.php
31+
- src/Cells/nav.php
32+
- src/Cells/navbar.php
33+
- src/Cells/offcanvas.php
34+
- src/Cells/pagination.php
35+
- src/Cells/placeholder.php
36+
- src/Cells/popover.php
37+
- src/Cells/progress.php
38+
- src/Cells/scrollspy.php
39+
- src/Cells/spinner.php
40+
- src/Cells/stats_cards.php
41+
- src/Cells/table.php
42+
- src/Cells/tabs.php
43+
- src/Cells/toast.php
44+
- src/Cells/tooltip.php
45+
- src/Cells/validation.php
1146
universalObjectCratesClasses:
1247
- CodeIgniter\Entity
1348
- CodeIgniter\Entity\Entity

psalm.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,41 @@
1919
<directory name="build" />
2020
<directory name="vendor" />
2121
<directory name="tests/_support" />
22+
<file name="src/Cells/accordion.php" />
23+
<file name="src/Cells/alert.php" />
24+
<file name="src/Cells/badge.php" />
25+
<file name="src/Cells/breadcrumb.php" />
26+
<file name="src/Cells/button.php" />
27+
<file name="src/Cells/button_group.php" />
28+
<file name="src/Cells/button_toolbar.php" />
29+
<file name="src/Cells/card.php" />
30+
<file name="src/Cells/carousel.php" />
31+
<file name="src/Cells/close_button.php" />
32+
<file name="src/Cells/collapse.php" />
33+
<file name="src/Cells/description_list.php" />
34+
<file name="src/Cells/dropdown.php" />
35+
<file name="src/Cells/empty_state.php" />
36+
<file name="src/Cells/figure.php" />
37+
<file name="src/Cells/form.php" />
38+
<file name="src/Cells/image.php" />
39+
<file name="src/Cells/input_group.php" />
40+
<file name="src/Cells/list_group.php" />
41+
<file name="src/Cells/modal.php" />
42+
<file name="src/Cells/nav.php" />
43+
<file name="src/Cells/navbar.php" />
44+
<file name="src/Cells/offcanvas.php" />
45+
<file name="src/Cells/pagination.php" />
46+
<file name="src/Cells/placeholder.php" />
47+
<file name="src/Cells/popover.php" />
48+
<file name="src/Cells/progress.php" />
49+
<file name="src/Cells/scrollspy.php" />
50+
<file name="src/Cells/spinner.php" />
51+
<file name="src/Cells/stats_cards.php" />
52+
<file name="src/Cells/table.php" />
53+
<file name="src/Cells/tabs.php" />
54+
<file name="src/Cells/toast.php" />
55+
<file name="src/Cells/tooltip.php" />
56+
<file name="src/Cells/validation.php" />
2257
</ignoreFiles>
2358
</projectFiles>
2459
</psalm>

src/Cells/AccordionCell.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ private function normalizeItems(string $accordionId, bool $escape): array
115115

116116
/**
117117
* Builds the classes applied to a single accordion item.
118+
*
119+
* @param array<string, mixed> $item
118120
*/
119121
private function buildItemClasses(array $item): string
120122
{

src/Cells/ButtonGroupCell.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ private function normalizeItems(bool $escape): array
158158

159159
/**
160160
* Builds the classes applied to an individual grouped button.
161+
*
162+
* @param array<string, mixed> $item
161163
*/
162164
private function buildButtonClasses(array $item, bool $active, bool $disabled, string $tag): string
163165
{
@@ -187,6 +189,8 @@ private function buildButtonClasses(array $item, bool $active, bool $disabled, s
187189

188190
/**
189191
* Resolves whether a grouped item renders as a link or a button.
192+
*
193+
* @param array<string, mixed> $item
190194
*/
191195
private function resolveTag(array $item): string
192196
{

src/Cells/ButtonToolbarCell.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ private function normalizeItems(mixed $rawItems, bool $escape): array
203203

204204
/**
205205
* Builds the classes applied to an individual toolbar button.
206+
*
207+
* @param array<string, mixed> $item
206208
*/
207209
private function buildButtonClasses(array $item, bool $active, bool $disabled, string $tag): string
208210
{
@@ -232,6 +234,8 @@ private function buildButtonClasses(array $item, bool $active, bool $disabled, s
232234

233235
/**
234236
* Resolves whether a toolbar item renders as a link or a button.
237+
*
238+
* @param array<string, mixed> $item
235239
*/
236240
private function resolveTag(array $item): string
237241
{

src/Cells/EmptyStateCell.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ public function render(): string
5858
/**
5959
* Normalizes the actions rendered below the empty state.
6060
*
61-
* @return list<array<string, string>>
61+
* @return list<array{
62+
* tag: 'a'|'button',
63+
* html: string,
64+
* attributes: array<string, string>
65+
* }>
6266
*/
6367
private function normalizeActions(bool $escape): array
6468
{

src/Cells/FormCell.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ private function normalizeItems(bool $escape): array
166166
/**
167167
* Normalizes a standard input field.
168168
*
169+
* @param array<string, mixed> $item
169170
* @return array<string, mixed>
170171
*/
171172
private function normalizeInputItem(array $item, bool $escape): array
@@ -198,6 +199,7 @@ private function normalizeInputItem(array $item, bool $escape): array
198199
/**
199200
* Normalizes a textarea field with its Bootstrap wrapper data.
200201
*
202+
* @param array<string, mixed> $item
201203
* @return array<string, mixed>
202204
*/
203205
private function normalizeTextareaItem(array $item, bool $escape): array
@@ -231,6 +233,7 @@ private function normalizeTextareaItem(array $item, bool $escape): array
231233
/**
232234
* Normalizes a `select` field and its options.
233235
*
236+
* @param array<string, mixed> $item
234237
* @return array<string, mixed>
235238
*/
236239
private function normalizeSelectItem(array $item, bool $escape): array
@@ -263,6 +266,7 @@ private function normalizeSelectItem(array $item, bool $escape): array
263266
/**
264267
* Normalizes a `checkbox`, `radio`, or `switch` control.
265268
*
269+
* @param array<string, mixed> $item
266270
* @return array<string, mixed>
267271
*/
268272
private function normalizeCheckItem(array $item, bool $escape, string $kind): array
@@ -292,6 +296,7 @@ private function normalizeCheckItem(array $item, bool $escape, string $kind): ar
292296
/**
293297
* Normalizes a simple form button item.
294298
*
299+
* @param array<string, mixed> $item
295300
* @return array<string, mixed>
296301
*/
297302
private function normalizeButtonItem(array $item, bool $escape, string $kind): array
@@ -331,6 +336,8 @@ private function normalizeButtonItem(array $item, bool $escape, string $kind): a
331336

332337
/**
333338
* Resolves the Bootstrap grid classes for a field.
339+
*
340+
* @param array<string, mixed> $item
334341
*/
335342
private function buildColumnClasses(array $item): string
336343
{
@@ -360,6 +367,8 @@ private function buildColumnClasses(array $item): string
360367

361368
/**
362369
* Builds the wrapper classes for a standard control.
370+
*
371+
* @param array<string, mixed> $item
363372
*/
364373
private function buildControlWrapperClasses(array $item, bool $floating): string
365374
{
@@ -375,6 +384,8 @@ private function buildControlWrapperClasses(array $item, bool $floating): string
375384

376385
/**
377386
* Builds the wrapper classes for a check-like control.
387+
*
388+
* @param array<string, mixed> $item
378389
*/
379390
private function buildCheckWrapperClasses(array $item, string $kind): string
380391
{
@@ -405,6 +416,8 @@ private function buildCheckWrapperClasses(array $item, string $kind): string
405416

406417
/**
407418
* Merges default wrapper classes with caller-provided classes.
419+
*
420+
* @param array<string, mixed> $item
408421
*/
409422
private function buildWrapperClasses(array $item, string $default): string
410423
{
@@ -426,6 +439,7 @@ private function buildWrapperClasses(array $item, string $default): string
426439
/**
427440
* Builds the attributes for a field label.
428441
*
442+
* @param array<string, mixed> $item
429443
* @return array<string, string>
430444
*/
431445
private function buildLabelAttributes(array $item, bool $floating = false): array
@@ -450,6 +464,7 @@ private function buildLabelAttributes(array $item, bool $floating = false): arra
450464
/**
451465
* Builds the attributes for a checkbox or radio label.
452466
*
467+
* @param array<string, mixed> $item
453468
* @return array<string, string>
454469
*/
455470
private function buildCheckLabelAttributes(array $item): array
@@ -470,6 +485,7 @@ private function buildCheckLabelAttributes(array $item): array
470485
/**
471486
* Builds the attributes for a field help block.
472487
*
488+
* @param array<string, mixed> $item
473489
* @return array<string, string>
474490
*/
475491
private function buildHelpAttributes(array $item): array
@@ -490,6 +506,7 @@ private function buildHelpAttributes(array $item): array
490506
/**
491507
* Builds the attributes for Bootstrap validation feedback blocks.
492508
*
509+
* @param array<string, mixed> $item
493510
* @return array<string, string>
494511
*/
495512
private function buildFeedbackAttributes(array $item, string $type): array
@@ -512,6 +529,7 @@ private function buildFeedbackAttributes(array $item, string $type): array
512529
/**
513530
* Builds the HTML attributes for a standard form control.
514531
*
532+
* @param array<string, mixed> $item
515533
* @return array<string, string>
516534
*/
517535
private function buildControlAttributes(array $item, string $kind, bool $withDescribedby = true): array
@@ -591,6 +609,8 @@ private function buildControlAttributes(array $item, string $kind, bool $withDes
591609

592610
/**
593611
* Resolves the final HTML type for an `input` control.
612+
*
613+
* @param array<string, mixed> $item
594614
*/
595615
private function resolveInputType(array $item): string
596616
{
@@ -616,6 +636,7 @@ private function resolveInputType(array $item): string
616636
/**
617637
* Builds the HTML attributes for a `select` field.
618638
*
639+
* @param array<string, mixed> $item
619640
* @return array<string, string>
620641
*/
621642
private function buildSelectAttributes(array $item): array
@@ -674,6 +695,7 @@ private function buildSelectAttributes(array $item): array
674695
/**
675696
* Builds the HTML attributes for a `checkbox` or `radio` control.
676697
*
698+
* @param array<string, mixed> $item
677699
* @return array<string, string>
678700
*/
679701
private function buildCheckAttributes(array $item, string $type): array
@@ -720,6 +742,8 @@ private function buildCheckAttributes(array $item, string $type): array
720742

721743
/**
722744
* Chooses the Bootstrap control class for the configured input type.
745+
*
746+
* @param array<string, mixed> $item
723747
*/
724748
private function resolveControlClass(array $item): string
725749
{
@@ -730,6 +754,8 @@ private function resolveControlClass(array $item): string
730754

731755
/**
732756
* Restricts the validation state to `valid`, `invalid`, or an empty string.
757+
*
758+
* @param array<string, mixed> $item
733759
*/
734760
private function normalizeState(array $item): string
735761
{
@@ -740,6 +766,8 @@ private function normalizeState(array $item): string
740766

741767
/**
742768
* Aggregates the ARIA ids linked to help and validation feedback.
769+
*
770+
* @param array<string, mixed> $item
743771
*/
744772
private function buildDescribedBy(array $item): string
745773
{
@@ -756,6 +784,8 @@ private function buildDescribedBy(array $item): string
756784

757785
/**
758786
* Generates the help id from the field id.
787+
*
788+
* @param array<string, mixed> $item
759789
*/
760790
private function resolveHelpId(array $item): string
761791
{
@@ -771,6 +801,8 @@ private function resolveHelpId(array $item): string
771801

772802
/**
773803
* Generates the feedback id for the requested feedback type.
804+
*
805+
* @param array<string, mixed> $item
774806
*/
775807
private function resolveFeedbackId(array $item, string $type): string
776808
{

0 commit comments

Comments
 (0)