Skip to content
Extraits de code Groupes Projets
Valider f2ec9dad rédigé par nicod's avatar nicod
Parcourir les fichiers

fix: Ajout de typage

parent 8d1f7ee7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -27,10 +27,11 @@ function blocks_serialize($data) { ...@@ -27,10 +27,11 @@ function blocks_serialize($data) {
* Désérialisation de données (saisies ou valeurs) * Désérialisation de données (saisies ou valeurs)
* *
* @param $data * @param $data
* @return mixed * @return array|null
*/ */
function blocks_deserialize($data) { function blocks_deserialize($data) {
return json_decode($data ?? '', true); $retour = json_decode($data ?? '', true);
return is_array($retour) ? $retour : null;
} }
/** /**
...@@ -69,11 +70,11 @@ function balise_GENERER_BLOCK_dist($p) { ...@@ -69,11 +70,11 @@ function balise_GENERER_BLOCK_dist($p) {
/** /**
* Fonction interne à la balise GENERER_BLOCK * Fonction interne à la balise GENERER_BLOCK
* *
* @param $id_block * @param int $id_block
* @return array|string * @return string
*/ */
function _block_charger_block($id_block) { function _block_charger_block(int $id_block): string {
$retour = ''; $html = '';
$where = ['b.id_block = ' . (int)$id_block]; $where = ['b.id_block = ' . (int)$id_block];
if (!test_espace_prive()) { if (!test_espace_prive()) {
$where[] = 'b.statut = ' . sql_quote('publie'); $where[] = 'b.statut = ' . sql_quote('publie');
...@@ -90,7 +91,7 @@ function _block_charger_block($id_block) { ...@@ -90,7 +91,7 @@ function _block_charger_block($id_block) {
$retour = recuperer_fond('inclure/block', $contexte); $retour = recuperer_fond('inclure/block', $contexte);
} }
return $retour; return $html;
} }
/** /**
...@@ -133,11 +134,11 @@ function balise_GENERER_BLOCKS_dist($p) { ...@@ -133,11 +134,11 @@ function balise_GENERER_BLOCKS_dist($p) {
/** /**
* Fonction interne à la balise GENERER_BLOCKS * Fonction interne à la balise GENERER_BLOCKS
* *
* @param $objet * @param string $objet
* @param $id_objet * @param int $id_objet
* @return string * @return string
*/ */
function _block_charger_blocks($objet, $id_objet): string { function _block_charger_blocks(string $objet, int $id_objet): string {
$retour = ''; $retour = '';
$where = [ $where = [
'objet = ' . sql_quote($objet), 'objet = ' . sql_quote($objet),
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter