Browse Source

feat(phpstan) : Mise en place de l'outil

pull/4873/head
JamesRezo 4 weeks ago
parent
commit
00feac8671
  1. 1
      .gitignore
  2. 5
      composer.json
  3. 417
      phpstan-baseline.neon
  4. 13
      phpstan.neon.dist

1
.gitignore

@ -2,6 +2,7 @@
/composer.phar
/composer.lock
/phpcs.xml
/phpstan.neon
**/.DS_Store
**/.htaccess

5
composer.json

@ -1,12 +1,15 @@
{
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"spip/coding-standards": "^1.2"
"spip/coding-standards": "^1.2",
"phpstan/phpstan": "^0.12.96"
},
"archive": {
"exclude": [
"composer.json",
"phpcs.xml.dist",
"phpstan.neon.dist",
"phpstan-baseline.neon",
"!plugins-dist",
"!squelettes-dist",
"!config/ecran_securite.php",

417
phpstan-baseline.neon

@ -0,0 +1,417 @@
parameters:
ignoreErrors:
-
message: "#^Function cache_get not found\\.$#"
count: 1
path: ecrire/action/redirect.php
-
message: "#^Function cache_set not found\\.$#"
count: 1
path: ecrire/action/redirect.php
-
message: "#^Function spip_connect_db\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: ecrire/base/connect_sql.php
-
message: "#^Array has 2 duplicate keys with value 350 \\(350, 350\\)\\.$#"
count: 1
path: ecrire/charsets/translit.php
-
message: "#^Array has 2 duplicate keys with value 351 \\(351, 351\\)\\.$#"
count: 1
path: ecrire/charsets/translit.php
-
message: "#^Array has 2 duplicate keys with value 8212 \\(8212, 8212\\)\\.$#"
count: 1
path: ecrire/charsets/translit.php
-
message: "#^Function exec_puce_statut_args\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/exec/puce_statut.php
-
message: "#^Function exec_puce_statut_dist\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/exec/puce_statut.php
-
message: "#^Function message_crash_tables\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/genie/maintenance.php
-
message: "#^Function boutons_plugins not found\\.$#"
count: 1
path: ecrire/inc/bandeau.php
-
message: "#^Function onglets_plugins not found\\.$#"
count: 1
path: ecrire/inc/boutons.php
-
message: "#^Function fichier_copie_locale\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/distant.php
-
message: "#^Function mention_qui_edite\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: ecrire/inc/drapeau_edition.php
-
message: "#^Function afficher_diff not found\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Function afficher_para_modifies not found\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Function preparer_diff not found\\.$#"
count: 2
path: ecrire/inc/editer.php
-
message: "#^Function propre_diff not found\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Function signaler_conflits_edition\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Instantiated class Diff not found\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Instantiated class DiffTexte not found\\.$#"
count: 1
path: ecrire/inc/editer.php
-
message: "#^Function mail_embarquer_pieces_jointes not found\\.$#"
count: 1
path: ecrire/inc/envoyer_mail.php
-
message: "#^Function compacte not found\\.$#"
count: 1
path: ecrire/inc/filtres.php
-
message: "#^Instantiated class csstidy not found\\.$#"
count: 1
path: ecrire/inc/filtres.php
-
message: "#^Function extraire_date\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/filtres_dates.php
-
message: "#^Function recup_date\\(\\) should return array but return statement is missing\\.$#"
count: 1
path: ecrire/inc/filtres_dates.php
-
message: "#^Function alertes_auteur\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/filtres_ecrire.php
-
message: "#^Function md5_boutons_plugins not found\\.$#"
count: 1
path: ecrire/inc/filtres_ecrire.php
-
message: "#^Class GdImage not found\\.$#"
count: 1
path: ecrire/inc/filtres_images_lib_mini.php
-
message: "#^Function statut_effacer_images_temporaires\\(\\) should return bool but return statement is missing\\.$#"
count: 1
path: ecrire/inc/filtres_images_lib_mini.php
-
message: "#^Function couleur_luminance not found\\.$#"
count: 1
path: ecrire/inc/filtres_images_mini.php
-
message: "#^Function couleur_saturation not found\\.$#"
count: 1
path: ecrire/inc/filtres_images_mini.php
-
message: "#^Function image_recadre not found\\.$#"
count: 1
path: ecrire/inc/filtres_images_mini.php
-
message: "#^Function sous_repertoire\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/flock.php
-
message: "#^Function compacte not found\\.$#"
count: 1
path: ecrire/inc/minipres.php
-
message: "#^Function minipres\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/minipres.php
-
message: "#^Function random not found\\.$#"
count: 1
path: ecrire/inc/nfslock.php
-
message: "#^Function cache_set not found\\.$#"
count: 1
path: ecrire/inc/queue.php
-
message: "#^Function cache_lock not found\\.$#"
count: 1
path: ecrire/inc/rechercher.php
-
message: "#^Function cache_unlock not found\\.$#"
count: 1
path: ecrire/inc/rechercher.php
-
message: "#^Function calculer_rubriques_if\\(\\) should return bool but return statement is missing\\.$#"
count: 1
path: ecrire/inc/rubriques.php
-
message: "#^Function charger_langue\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/inc/traduire.php
-
message: "#^Function recuperer_parametres_url not found\\.$#"
count: 1
path: ecrire/inc/urls.php
-
message: "#^Function cache_get not found\\.$#"
count: 1
path: ecrire/inc/utils.php
-
message: "#^Result of function debug_print_backtrace \\(void\\) is used\\.$#"
count: 1
path: ecrire/inc/utils.php
-
message: "#^Undefined variable\\: \\$auth_spip$#"
count: 1
path: ecrire/install/etape_3b.php
-
message: "#^Undefined variable\\: \\$row$#"
count: 1
path: ecrire/install/etape_3b.php
-
message: "#^Undefined variable\\: \\$session$#"
count: 1
path: ecrire/install/etape_3b.php
-
message: "#^Class IterateurDATA referenced with incorrect case\\: IterateurData\\.$#"
count: 1
path: ecrire/iterateur/condition.php
-
message: "#^Access to an undefined property IterateurDATA\\:\\:\\$command\\.$#"
count: 32
path: ecrire/iterateur/data.php
-
message: "#^Access to an undefined property IterateurDATA\\:\\:\\$info\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Access to an undefined property IterateurDATA\\:\\:\\$type\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Function analyser_backend not found\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Function cache_get not found\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Function cache_set not found\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Function inc_json_to_array_dist\\(\\) should return array\\|bool but return statement is missing\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Function yaml_decode not found\\.$#"
count: 1
path: ecrire/iterateur/data.php
-
message: "#^Access to an undefined property IterateurSQL\\:\\:\\$command\\.$#"
count: 7
path: ecrire/iterateur/sql.php
-
message: "#^Access to an undefined property IterateurSQL\\:\\:\\$info\\.$#"
count: 2
path: ecrire/iterateur/sql.php
-
message: "#^Access to an undefined property IterateurSQL\\:\\:\\$pos\\.$#"
count: 6
path: ecrire/iterateur/sql.php
-
message: "#^Access to an undefined property IterateurSQL\\:\\:\\$type\\.$#"
count: 1
path: ecrire/iterateur/sql.php
-
message: "#^Function icone_lien_cfg not found\\.$#"
count: 1
path: ecrire/plugins/afficher_plugin.php
-
message: "#^Function inclure_balise_dynamique\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ecrire/public/assembler.php
-
message: "#^Undefined variable\\: \\$chemin_cache$#"
count: 4
path: ecrire/public/assembler.php
-
message: "#^Undefined variable\\: \\$lastinclude$#"
count: 3
path: ecrire/public/assembler.php
-
message: "#^Undefined variable\\: \\$lastmodified$#"
count: 2
path: ecrire/public/assembler.php
-
message: "#^Undefined variable\\: \\$use_cache$#"
count: 1
path: ecrire/public/assembler.php
-
message: "#^Function balise_COMPTEUR_BOUCLE_dist\\(\\) should return Champ but return statement is missing\\.$#"
count: 1
path: ecrire/public/balises.php
-
message: "#^Function balise_ENV not found\\.$#"
count: 1
path: ecrire/public/balises.php
-
message: "#^Function balise_FILTRE_dist\\(\\) should return Champ but return statement is missing\\.$#"
count: 1
path: ecrire/public/balises.php
-
message: "#^Function balise_INCLURE not found\\.$#"
count: 1
path: ecrire/public/balises.php
-
message: "#^Result of function creer_cache \\(void\\) is used\\.$#"
count: 1
path: ecrire/public/cacher.php
-
message: "#^Function critere_par_ordre_liste_dist\\(\\) should return array\\|string but return statement is missing\\.$#"
count: 1
path: ecrire/public/criteres.php
-
message: "#^Result of function calculer_critere_parties \\(void\\) is used\\.$#"
count: 1
path: ecrire/public/criteres.php
-
message: "#^Function image_du_document not found\\.$#"
count: 1
path: ecrire/public/quete.php
-
message: "#^Function vignette_automatique not found\\.$#"
count: 1
path: ecrire/public/quete.php
-
message: "#^Function spip_mysql_seek\\(\\) should return bool but return statement is missing\\.$#"
count: 1
path: ecrire/req/mysql.php
-
message: "#^Function spip_mysql_update\\(\\) should return array\\|bool\\|string but return statement is missing\\.$#"
count: 1
path: ecrire/req/mysql.php
-
message: "#^Result of function mysqli_free_result \\(void\\) is used\\.$#"
count: 1
path: ecrire/req/mysql.php
-
message: "#^Function spip_pg_selectdb\\(\\) should return bool\\|string but return statement is missing\\.$#"
count: 1
path: ecrire/req/pg.exp.php
-
message: "#^Function spip_sqlite_selectdb\\(\\) should return bool\\|string but return statement is missing\\.$#"
count: 1
path: ecrire/req/sqlite_generique.php
-
message: "#^Function spip_sqlite_update\\(\\) should return array\\|bool\\|string but return statement is missing\\.$#"
count: 1
path: ecrire/req/sqlite_generique.php
-
message: "#^Function corriger_extension not found\\.$#"
count: 1
path: prive/formulaires/configurer_ecran_connexion.php
-
message: "#^Function serialise not found\\.$#"
count: 1
path: prive/formulaires/configurer_metas.php

13
phpstan.neon.dist

@ -0,0 +1,13 @@
includes:
- phpstan-baseline.neon
parameters:
paths:
- ecrire
- prive
excludePaths:
analyseAndScan:
- ecrire/lang
analyse:
- ecrire/inc/idna_convert.class.php
level: 0
Loading…
Cancel
Save