Fix code styling

This commit is contained in:
Fedor A. Fetisov 2021-07-09 23:19:03 +03:00
parent 7bdec8e106
commit 9f7340ec78
14 changed files with 1853 additions and 1837 deletions

View File

@ -53,5 +53,3 @@
// Output the result formatted nice with indents
echo $doc;
?>

View File

@ -135,10 +135,14 @@ namespace Canteen\HTML5
public function __get($name)
{
if (method_exists($this , $method =('get' . ucfirst($name))))
{
return $this->$method();
}
else
{
throw new HTML5Error(HTML5Error::INVALID_GETTER, $name);
}
}
/**
* General purpose setter for setting attribute->name and attribute->value
@ -149,10 +153,14 @@ namespace Canteen\HTML5
public function __set($name, $value)
{
if (method_exists($this , $method =('set' . ucfirst($name))))
{
return $this->$method($value);
}
else
{
throw new HTML5Error(HTML5Error::INVALID_SETTER, $name);
}
}
/**
* See if a property exists
@ -166,5 +174,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -34,5 +34,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -86,7 +86,9 @@ namespace Canteen\HTML5
{
$result = $this->docType . parent::__toString();
if ($this->beautify)
{
$result = self::beautify($result);
}
return $result;
}
@ -113,5 +115,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -39,5 +39,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -22,7 +22,10 @@ namespace Canteen\HTML5
spl_autoload_register(function($name)
{
// Ignore class names not in the HTML5 namespace
if (!preg_match('/^Canteen\\\HTML5\\\/', $name)) return;
if (!preg_match('/^Canteen\\\HTML5\\\/', $name))
{
return;
}
// Remove the HTML5 namespace
$name = preg_replace('/^Canteen\\\HTML5\\\/', '', $name);
@ -160,7 +163,9 @@ namespace Canteen\HTML5
$node->id = substr($selector, 1);
break;
case '.' :
if ($node->class) $node->class .= ' ';
if ($node->class) {
$node->class .= ' ';
}
$node->class .= substr($selector, 1);
break;
}

View File

@ -140,5 +140,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -139,9 +139,13 @@ namespace Canteen\HTML5
if ($attribute->name === $name)
{
if (!$this->isEmpty($value))
{
$attribute->value = $value;
}
else
{
unset($this->_attributes[$i]);
}
return $this;
}
}
@ -337,5 +341,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -233,5 +233,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -68,5 +68,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -58,7 +58,9 @@ namespace Canteen\HTML5
'target'
),
'bdo' => array(),
'blockquote' => array('cite'),
'blockquote' => array(
'cite'
),
'body' => array(),
'br' => array(),
'button' => array(
@ -82,7 +84,9 @@ namespace Canteen\HTML5
'cite' => array(),
'code' => array(),
'col' => null,
'colgroup' => array('span'),
'colgroup' => array(
'span'
),
'command' => array(
'checked',
'disabled',
@ -137,7 +141,9 @@ namespace Canteen\HTML5
'header' => array(),
'hgroup' => array(),
'hr' => array(),
'html' => array('manifest'),
'html' => array(
'manifest'
),
'img' => array(
'alt',
'crossorigin',
@ -207,7 +213,9 @@ namespace Canteen\HTML5
'sizes',
'type'
),
'map' => array('name'),
'map' => array(
'name'
),
'mark' => array(),
'menu' => array(),
'meta' => array(
@ -266,7 +274,9 @@ namespace Canteen\HTML5
'max',
'value'
),
'q' => array('cite'),
'q' => array(
'cite'
),
'rp' => array(),
'rt' => array(),
'ruby' => array(),
@ -290,18 +300,22 @@ namespace Canteen\HTML5
'size'
),
'small' => array(),
'source' => array('media',
'source' => array(
'media',
'src',
'type'
),
'span' => array(),
'strong' => array(),
'style' => array('media',
'style' => array(
'media',
'scoped',
'type'
),
'sub' => array(),
'table' => array('border'),
'table' => array(
'border'
),
'tbody' => array(),
'td' => array(
'colspan',
@ -329,7 +343,9 @@ namespace Canteen\HTML5
'scope'
),
'thead' => array(),
'time' => array('datetime'),
'time' => array(
'datetime'
),
'title' => array(),
'tr' => array(),
'track' => array(

View File

@ -72,7 +72,10 @@ namespace Canteen\HTML5
}
foreach ($d as $name=>$value)
{
if ($name == $checkbox) continue;
if ($name == $checkbox)
{
continue;
}
$td = html('td', $value, 'class=' . $name);
$row->addChild($td);
}
@ -82,5 +85,3 @@ namespace Canteen\HTML5
}
}
}
?>

View File

@ -35,5 +35,3 @@ namespace Canteen\HTML5
}
}
}
?>