[DOCUMENTATION][TOOL] Small bug fixes and docblock elaboration

This commit is contained in:
Diogo Cordeiro
2020-05-10 21:43:15 +01:00
committed by Hugo Sales
parent 243aefe683
commit cb7518a750
74 changed files with 655 additions and 449 deletions

View File

@@ -3,7 +3,7 @@
// This file is part of GNU social - https://www.gnu.org/software/soci
//
// GNU social is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as publ
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
@@ -12,7 +12,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public Li
// You should have received a copy of the GNU Affero General Public License
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
// }}}
@@ -32,7 +32,10 @@ abstract class HTML
/**
* Creates an HTML tag without attributes
*
* @param string $tag
* @param array|string $content
* @param bool $empty_tag
* @return array
*/
private static function tag(string $tag, $content = '', bool $empty_tag = false): array
{
@@ -42,8 +45,11 @@ abstract class HTML
/**
* Create tag, possibly with attributes and indentation
*
* @param array|string $attrs - element attributes
* @param string $tag
* @param array|string $attrs - element attributes
* @param array|string $content - what goes inside the tag
* @param bool $empty_tag
* @return array
*/
private static function attr_tag(string $tag, $attrs, $content = '', bool $empty_tag = false): array
{
@@ -59,13 +65,18 @@ abstract class HTML
/**
* Attribute with given optional value
*
* @param array $attr
* @param array $attrs
* @return string
*/
private static function attr(array $attrs): string
{
return ' ' . implode(' ', F\map($attrs, function ($val, $key, $_) { return "{$key} = '{$val}'"; }));
}
/**
* @param $html
* @return string
*/
public static function html($html): string
{
if (is_string($html)) {