Skip to content

Commit b76f90f

Browse files
committed
lint
1 parent b1d9121 commit b76f90f

13 files changed

Lines changed: 18 additions & 30 deletions

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: "Generate CI matrix"
2121
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
2222
with:
23-
glpi-version: "11.0.x"
23+
glpi-version: "12.0.x"
2424
ci:
2525
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
2626
needs: "generate-ci-matrix"

inc/container.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,7 @@ public static function preItem(CommonDBTM $item)
19351935
$entities = getSonsOf(getTableForItemType('Entity'), $loc_c->fields['entities_id']);
19361936
}
19371937

1938-
if (count($item->fields) === 0) {
1938+
if ($item->fields === []) {
19391939
$item->fields = $item->input;
19401940
}
19411941

inc/containerdisplaycondition.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public static function removeBlackListedOption($array, $itemtype_class)
383383
$main_table == getTableForItemType($itemtype_class)
384384
) {
385385
foreach ($foreignKey as $foreign_class) {
386-
if (!is_array($foreign_class) && getTableNameForForeignKeyField($foreign_class) != getTableForItemType(Location::getType())) {
386+
if (!is_array($foreign_class) && getTableNameForForeignKeyField($foreign_class) !== getTableForItemType(Location::getType())) {
387387
$allowed_table[] = getTableForItemType(getItemtypeForForeignKeyField($foreign_class));
388388
}
389389
}

inc/destinationfield.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function applyConfiguratedValueToInputUsingAnswers(
106106
continue;
107107
}
108108

109-
/** @var object{field_name: string} $item */
109+
/** @var CommonGLPI&object{field_name: string} $item */
110110
$item = getItemForItemtype($itemtype);
111111
$field = new PluginFieldsField();
112112
if (!$field->getFromDBByCrit(['name' => $item->field_name])) {

src/Controller/QuestionTypeAjaxController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function __invoke(Request $request): Response
7676
$current_container = PluginFieldsContainer::getById((int) $block_id);
7777
$current_field = PluginFieldsField::getById($current_field_id);
7878

79-
if (!$current_container || !$current_field || empty($current_field->fields)) {
79+
if (!$current_container || !$current_field || $current_field->fields === []) {
8080
return new Response('Invalid container or field', Response::HTTP_BAD_REQUEST);
8181
}
8282

templates/container_display_conditions.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@
8686
data-bs-toggle="tooltip" data-bs-placement="top">
8787
<i class="ti ti-trash"></i>
8888
</button>
89-
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
9089
</form>
9190
</td>
9291
</tr>

templates/forms/container_display_condition.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
<span>{{ _x('button', 'Add') }}</span>
9393
</button>
9494
{% endif %}
95-
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
9695
</div>
9796
</div> {# .row #}
9897
</div> {# .flex-row #}

templates/forms/status_override.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
<span>{{ _x('button', 'Update') }}</span>
6565
</button>
6666
{% endif %}
67-
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
6867
</div>
6968
</div> {# .row #}
7069
</div> {# .flex-row #}

templates/forms/tab_container.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
{{ html_fields|raw }}
4343

4444
{% if canedit %}
45-
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
4645
<div class="card-body mt-3 mx-n2 border-top d-flex flex-row-reverse align-items-start flex-wrap">
4746
<button class="btn btn-primary me-2" type="submit" name="update_fields_values" value="1">
4847
<i class="ti ti-device-floppy"></i>

templates/status_overrides.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
data-bs-toggle="tooltip" data-bs-placement="top">
9696
<i class="ti ti-trash"></i>
9797
</button>
98-
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}" />
9998
</form>
10099
</td>
101100
</tr>

0 commit comments

Comments
 (0)