Update Composer packages

This commit is contained in:
Paul Nicoué 2023-04-14 16:34:06 +02:00
parent 67c3d8b307
commit 83cb211fe6
219 changed files with 6487 additions and 4444 deletions

View file

@ -19,17 +19,13 @@ class Html extends Xml
{
/**
* An internal store for an HTML entities translation table
*
* @var array
*/
public static $entities;
public static array|null $entities;
/**
* List of HTML tags that can be used inline
*
* @var array
*/
public static $inlineList = [
public static array $inlineList = [
'b',
'i',
'small',
@ -144,6 +140,11 @@ class Html extends Xml
return $value === true ? strtolower($name) : null;
}
// HTML attribute names are case-insensitive
if (is_string($name) === true) {
$name = strtolower($name);
}
// all other cases can share the XML variant
$attr = parent::attr($name, $value);
@ -375,7 +376,7 @@ class Html extends Xml
return trim($rel . ' noopener noreferrer', ' ');
}
return $rel;
return $rel ?: null;
}
/**
@ -389,13 +390,11 @@ class Html extends Xml
* @param int $level Indentation level
* @return string The generated HTML
*/
public static function tag(string $name, $content = '', array $attr = null, string $indent = null, int $level = 0): string
public static function tag(string $name, $content = '', array $attr = [], string $indent = null, int $level = 0): string
{
// treat an explicit `null` value as an empty tag
// as void tags are already covered below
if ($content === null) {
$content = '';
}
$content ??= '';
// force void elements to be self-closing
if (static::isVoid($name) === true) {
@ -629,7 +628,7 @@ class Html extends Xml
}
// build the full video src URL
$src = $src . $query->toString(true);
$src .= $query->toString(true);
// render the iframe
return static::iframe($src, static::videoAttr($attr));