From 9a8dfe602519310321c37e3af43ef7e069bf6ce6 Mon Sep 17 00:00:00 2001
From: Matthieu Marcillaud <marcimat@rezo.net>
Date: Mon, 19 Jun 2023 20:52:38 +0200
Subject: [PATCH] =?UTF-8?q?chore:=20Typer=20retour=20sous=5Frepertoire().?=
 =?UTF-8?q?=20Il=20faudrait=20une=20exception=20=C3=A0=20la=20place=20de?=
 =?UTF-8?q?=20raler=20fichier=E2=80=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ecrire/inc/flock.php  | 3 ++-
 phpstan-baseline.neon | 5 -----
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/ecrire/inc/flock.php b/ecrire/inc/flock.php
index 72fd99e927..43a9cb2054 100644
--- a/ecrire/inc/flock.php
+++ b/ecrire/inc/flock.php
@@ -611,7 +611,7 @@ function supprimer_repertoire($dir) {
  * @return string
  *     Chemin du répertoire créé.
  **/
-function sous_repertoire($base, $subdir = '', $nobase = false, $tantpis = false) {
+function sous_repertoire($base, $subdir = '', $nobase = false, $tantpis = false): string {
 	static $dirs = [];
 
 	$base = str_replace('//', '/', $base);
@@ -658,6 +658,7 @@ function sous_repertoire($base, $subdir = '', $nobase = false, $tantpis = false)
 	if ($tantpis) {
 		return '';
 	}
+	// FIXME: throw an Exception…
 	if (!_DIR_RESTREINT) {
 		$base = preg_replace(',^' . _DIR_RACINE . ',', '', $base);
 	}
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index 2528b1e526..9aa9e021b5 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -5,11 +5,6 @@ parameters:
 			count: 1
 			path: ecrire/inc/filtres.php
 
-		-
-			message: "#^Function sous_repertoire\\(\\) should return string but return statement is missing\\.$#"
-			count: 1
-			path: ecrire/inc/flock.php
-
 		-
 			message: "#^Function cache_unlock not found\\.$#"
 			count: 1
-- 
GitLab