modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2023-12-30 18:41:20 +04:00
parent b97515782b
commit fbc70cb834
2 changed files with 3 additions and 7 deletions

View File

@ -7,12 +7,8 @@ use nulib\cl;
* Class content: gestionnaire de contenu (statique ou dynamique) * Class content: gestionnaire de contenu (statique ou dynamique)
*/ */
class content { class content {
/** /** quoter $vs si c'est un scalaire. sinon retourner le tableau tel quel */
* quoter $vs si c'est un scalaire. sinon retourner le tableau tel quel static final function quote($contents): iterable {
*
* NB: cette méthode est accessible via la fonction globale {@link q()}
*/
static final function q($contents): iterable {
if ($contents === null || $contents === false) return []; if ($contents === null || $contents === false) return [];
elseif ($contents instanceof IContent) return [$contents]; elseif ($contents instanceof IContent) return [$contents];
elseif ($contents instanceof IPrintable) return [$contents]; elseif ($contents instanceof IPrintable) return [$contents];

View File

@ -16,7 +16,7 @@ class ATag implements IStaticContent {
function getContent(): iterable { function getContent(): iterable {
return [ return [
"<$this->tag>", "<$this->tag>",
...content::q($this->contents), ...content::quote($this->contents),
"</$this->tag>", "</$this->tag>",
]; ];
} }