build : phpstan level 4

master
RealET 2 months ago
parent 8234c9a431
commit 1e0e41a97e

@ -662,7 +662,7 @@ function create_document($chemin, $objet, $mode, $champs = 'non', $id_document =
$type = ($objet['type'] ?? '');
$id_objet = ($objet['id_objet'] ?? 0);
spip_log(['tmp_name' => $chemin, 'name' => basename($chemin)], 'docusc');
if ($id_document = 'non' and $chemin) {
if ($id_document == 'non' and $chemin) {
autoriser_exception('associerdocuments', $type, $id_objet);
$id_document = action_ajouter_un_document_dist('non', ['tmp_name' => $chemin, 'name' => basename($chemin)], $type, $id_objet, $mode);
autoriser_exception('associerdocuments', $type, $id_objet, false);
@ -671,7 +671,8 @@ function create_document($chemin, $objet, $mode, $champs = 'non', $id_document =
}
return $id_document;
}
else { return false;
else {
return false;
}
}

@ -74,8 +74,6 @@ if (defined('_DIR_PLUGIN_MAILSUBSCRIBERS')) {
$listes = _request('listes');
if ($listes and is_string($listes)) {
$listes = explode(',', $listes);
}
if ($listes and is_array($listes) and count($listes)) {
$options['listes'] = $listes;
}

@ -1140,7 +1140,7 @@ $raz = $regs[1];
$href = parametre_url($href, 'prive', $prive);
$href = parametre_url($href, 'ancre', $ancre);
$href = calendrier_args_date($href, $annee, $mois, $jour, '', "$arg_echelle" . ((DEFAUT_PARTIE == DEFAUT_PARTIE_R) ? '' : ('&partie_cal=' . DEFAUT_PARTIE_R)));
$href = calendrier_args_date($href, $annee, $mois, $jour, '', "$arg_echelle");
$id = ($ancre ?: 'agenda') . '-nav';
$onmouseover = "if (!this.trimestre)\n{this.trimestre=!charger_node_url('$href', document.getElementById('$id'));}\n;$('#$id').css('visibility','visible').show();";
@ -1404,7 +1404,7 @@ function http_calendrier_agenda_rv(
(($jour_semaine == 1) ? " calendrier-$spip_lang_left" :
(($jour_semaine == 7) ? " calendrier-$spip_lang_right" :
''));
$type = ($semaine ? 'semaine' : 'jour') ;
$type = 'semaine';
} else {
if ($j == $jour_today and $cemois) {
$toile = ' jour_encours';
@ -1425,8 +1425,7 @@ function http_calendrier_agenda_rv(
$corps = $fclic($script, $annee, $mois, $j, $type, '', $ancre, '', $title, '', '', $j);
$ligne .= "\n<td class='$class'>$corps</td>";
if ($jour_semaine == 7) {
if ($ligne) { $total .= "\n<tr>$ligne</tr>";
}
$total .= "\n<tr>$ligne</tr>";
$ligne = '';
}
}

@ -875,6 +875,11 @@ parameters:
count: 1
path: soyezcreateurs_fonctions.php
-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: soyezcreateurs_fonctions.php
-
message: "#^Access to property \\$texte on an unknown class Texte\\.$#"
count: 4

@ -7,6 +7,6 @@ parameters:
excludePaths:
analyseAndScan:
- lang
level: 3
level: 4
bootstrapFiles:
- phpstan-constants.php

Loading…
Cancel
Save