chore: phpstan jusqu'au niveau 1, après il faut faire trop de modif

master v8.0.0
Maïeul 6 months ago
parent ca9207fe51
commit c6eccdbeff

20
.gitattributes vendored

@ -1,16 +1,4 @@
* text=auto !eol
formulaires/configurer_zippeur.html -text
genie/zippeur_effacer_zip.php -text
images/zip.png -text
images/zip_cfg.png -text
inc/zippeur_dynamique.php -text
lang/paquet-zippeur_fr.php -text
lang/zippeur_fr.php -text
modeles/zip_doc_album.html -text
modeles/zip_doc_article.html -text
/paquet.xml -text
prive/squelettes/contenu/configurer_zippeur.html -text
prive/squelettes/navigation/configurer_zippeur.html -text
/zippeur_administrations.php -text
/zippeur_fonctions.php -text
/zippeur_pipelines.php -text
# .gitattribute
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpcs.xml.dist

File diff suppressed because one or more lines are too long

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<ruleset>
<file>.</file>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>lang/*</exclude-pattern>
<rule ref="SPIP42"/>
<config name="ignore_warnings_on_exit" value="1"/>
<arg name="cache" value=".php_cs.cache"/>
<arg name="report-full" value=".php_cs.txt"/>
<arg name="report-summary"/>
<arg value="s"/>
</ruleset>

@ -0,0 +1,246 @@
parameters:
ignoreErrors:
-
message: "#^Constant _DIR_RACINE not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Constant _NOM_TEMPORAIRES_ACCESSIBLES not found\\.$#"
count: 2
path: genie/zippeur_effacer_zip.php
-
message: "#^Constant _ZIPPEUR_MAX_EFFACER_ZIP not found\\.$#"
count: 2
path: genie/zippeur_effacer_zip.php
-
message: "#^Function effacer_repertoire not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function spip_log not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function sql_delete not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function sql_fetch not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function sql_select not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function supprimer_fichier not found\\.$#"
count: 1
path: genie/zippeur_effacer_zip.php
-
message: "#^Function ecrire_fichier not found\\.$#"
count: 1
path: inc/zippeur_dynamique.php
-
message: "#^Function find_in_path not found\\.$#"
count: 2
path: inc/zippeur_dynamique.php
-
message: "#^Function preg_files not found\\.$#"
count: 1
path: inc/zippeur_dynamique.php
-
message: "#^Function recuperer_fond not found\\.$#"
count: 1
path: inc/zippeur_dynamique.php
-
message: "#^Function sous_repertoire not found\\.$#"
count: 1
path: inc/zippeur_dynamique.php
-
message: "#^Constant _DIR_RACINE not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Constant _NOM_TEMPORAIRES_ACCESSIBLES not found\\.$#"
count: 2
path: zippeur_administrations.php
-
message: "#^Function creer_base not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function ecrire_config not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function ecrire_meta not found\\.$#"
count: 8
path: zippeur_administrations.php
-
message: "#^Function effacer_config not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function effacer_meta not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function include_spip not found\\.$#"
count: 4
path: zippeur_administrations.php
-
message: "#^Function maj_tables not found\\.$#"
count: 4
path: zippeur_administrations.php
-
message: "#^Function preg_files not found\\.$#"
count: 2
path: zippeur_administrations.php
-
message: "#^Function sql_drop_table not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function sql_updateq not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Function supprimer_fichier not found\\.$#"
count: 1
path: zippeur_administrations.php
-
message: "#^Constant _DIR_RACINE not found\\.$#"
count: 2
path: zippeur_fonctions.php
-
message: "#^Constant _LOG_ERREUR not found\\.$#"
count: 2
path: zippeur_fonctions.php
-
message: "#^Constant _NOM_TEMPORAIRES_ACCESSIBLES not found\\.$#"
count: 2
path: zippeur_fonctions.php
-
message: "#^Function copie_locale not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function find_in_path not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function include_spip not found\\.$#"
count: 3
path: zippeur_fonctions.php
-
message: "#^Function preg_files not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function sous_repertoire not found\\.$#"
count: 2
path: zippeur_fonctions.php
-
message: "#^Function spip_log not found\\.$#"
count: 5
path: zippeur_fonctions.php
-
message: "#^Function sql_fetsel not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function sql_insertq not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function sql_updateq not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function supprimer_fichier not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function test_espace_prive not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function valeur_numerique not found\\.$#"
count: 1
path: zippeur_fonctions.php
-
message: "#^Function _T not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function copie_locale not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function generer_info_entite not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function get_spip_doc not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function sql_fetch not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function sql_select not found\\.$#"
count: 1
path: zippeur_pipelines.php
-
message: "#^Function taille_en_octets not found\\.$#"
count: 1
path: zippeur_pipelines.php

@ -0,0 +1,10 @@
# phpstan.neon.dist
includes:
- phpstan-baseline.neon
parameters:
paths:
- .
excludePaths:
analyseAndScan:
- lang
level: 1

@ -5,9 +5,8 @@ if (!defined('_ECRIRE_INC_VERSION')) {
}
function zippeur_chemin_dossier_local() {
if (!isset($chemin)) {
static $chemin = '';
static $chemin = '';
if (!$chemin) {
if (defined('_DIR_SITE')) {
$chemin = _DIR_SITE . _NOM_TEMPORAIRES_ACCESSIBLES;
}

@ -42,6 +42,7 @@ function zippeur_pre_liens($txt) {
$fichiers = [];
$sql = sql_select('maj,fichier', 'spip_documents INNER JOIN spip_documents_liens as L1', "spip_documents.statut='publie' AND L1.id_objet='$id_objet' AND L1.objet='$objet'", '', 'spip_documents.maj DESC');
$first = true;
$maj = '';
while ($r = sql_fetch($sql)) {
if ($first == true) {
$maj = $r['maj'];

Loading…
Cancel
Save