metadata, sectioning, and header content tags
This commit is contained in:
parent
abaccd2fc7
commit
0cecf9cc72
23 changed files with 342 additions and 4 deletions
7
src/ContentCategories/FlowContent.php
Normal file
7
src/ContentCategories/FlowContent.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\ContentCategories;
|
||||||
|
|
||||||
|
interface FlowContent
|
||||||
|
{
|
||||||
|
}
|
7
src/ContentCategories/HeadingContent.php
Normal file
7
src/ContentCategories/HeadingContent.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\ContentCategories;
|
||||||
|
|
||||||
|
interface HeadingContent extends FlowContent
|
||||||
|
{
|
||||||
|
}
|
7
src/ContentCategories/MetadataContent.php
Normal file
7
src/ContentCategories/MetadataContent.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\ContentCategories;
|
||||||
|
|
||||||
|
interface MetadataContent
|
||||||
|
{
|
||||||
|
}
|
7
src/ContentCategories/PhrasingContent.php
Normal file
7
src/ContentCategories/PhrasingContent.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\ContentCategories;
|
||||||
|
|
||||||
|
interface PhrasingContent extends FlowContent
|
||||||
|
{
|
||||||
|
}
|
7
src/ContentCategories/SectioningContent.php
Normal file
7
src/ContentCategories/SectioningContent.php
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\ContentCategories;
|
||||||
|
|
||||||
|
interface SectioningContent extends FlowContent
|
||||||
|
{
|
||||||
|
}
|
10
src/Html5/AbstractTags/AbstractHeaderTag.php
Normal file
10
src/Html5/AbstractTags/AbstractHeaderTag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\AbstractTags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\HeadingContent;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
abstract class AbstractHeaderTag extends AbstractContainerTag implements HeadingContent
|
||||||
|
{
|
||||||
|
}
|
12
src/Html5/Tags/ArticleTag.php
Normal file
12
src/Html5/Tags/ArticleTag.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\SectioningContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayBlock;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
class ArticleTag extends AbstractContainerTag implements DisplayBlock, SectioningContent
|
||||||
|
{
|
||||||
|
const TAG = 'article';
|
||||||
|
}
|
12
src/Html5/Tags/AsideTag.php
Normal file
12
src/Html5/Tags/AsideTag.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\SectioningContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayBlock;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
class AsideTag extends AbstractContainerTag implements DisplayBlock, SectioningContent
|
||||||
|
{
|
||||||
|
const TAG = 'aside';
|
||||||
|
}
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
namespace ByJoby\HTML\Html5\Tags;
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
use ByJoby\HTML\Tags\AbstractTag;
|
use ByJoby\HTML\Tags\AbstractTag;
|
||||||
|
|
||||||
class BaseTag extends AbstractTag
|
class BaseTag extends AbstractTag implements MetadataContent
|
||||||
{
|
{
|
||||||
const TAG = 'base';
|
const TAG = 'base';
|
||||||
|
|
||||||
|
|
10
src/Html5/Tags/H1Tag.php
Normal file
10
src/Html5/Tags/H1Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H1Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h1';
|
||||||
|
}
|
10
src/Html5/Tags/H2Tag.php
Normal file
10
src/Html5/Tags/H2Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H2Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h1';
|
||||||
|
}
|
10
src/Html5/Tags/H3Tag.php
Normal file
10
src/Html5/Tags/H3Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H3Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h3';
|
||||||
|
}
|
10
src/Html5/Tags/H4Tag.php
Normal file
10
src/Html5/Tags/H4Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H4Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h4';
|
||||||
|
}
|
10
src/Html5/Tags/H5Tag.php
Normal file
10
src/Html5/Tags/H5Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H5Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h5';
|
||||||
|
}
|
10
src/Html5/Tags/H6Tag.php
Normal file
10
src/Html5/Tags/H6Tag.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\Html5\AbstractTags\AbstractHeaderTag;
|
||||||
|
|
||||||
|
class H6Tag extends AbstractHeaderTag
|
||||||
|
{
|
||||||
|
const TAG = 'h6';
|
||||||
|
}
|
12
src/Html5/Tags/HgroupTag.php
Normal file
12
src/Html5/Tags/HgroupTag.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\HeadingContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayBlock;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
class HgroupTag extends AbstractContainerTag implements DisplayBlock, HeadingContent
|
||||||
|
{
|
||||||
|
const TAG = 'hgroup';
|
||||||
|
}
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
namespace ByJoby\HTML\Html5\Tags;
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
use ByJoby\HTML\Tags\AbstractTag;
|
use ByJoby\HTML\Tags\AbstractTag;
|
||||||
|
|
||||||
class LinkTag extends AbstractTag
|
class LinkTag extends AbstractTag implements MetadataContent
|
||||||
{
|
{
|
||||||
const TAG = 'link';
|
const TAG = 'link';
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
namespace ByJoby\HTML\Html5\Tags;
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
use ByJoby\HTML\Tags\AbstractTag;
|
use ByJoby\HTML\Tags\AbstractTag;
|
||||||
|
|
||||||
class MetaTag extends AbstractTag
|
class MetaTag extends AbstractTag implements MetadataContent
|
||||||
{
|
{
|
||||||
const TAG = 'meta';
|
const TAG = 'meta';
|
||||||
|
|
||||||
|
|
12
src/Html5/Tags/NavTag.php
Normal file
12
src/Html5/Tags/NavTag.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\SectioningContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayBlock;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
class NavTag extends AbstractContainerTag implements DisplayBlock, SectioningContent
|
||||||
|
{
|
||||||
|
const TAG = 'nav';
|
||||||
|
}
|
13
src/Html5/Tags/NoscriptTag.php
Normal file
13
src/Html5/Tags/NoscriptTag.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
|
use ByJoby\HTML\ContentCategories\PhrasingContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayContents;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContentTag;
|
||||||
|
|
||||||
|
class NoscriptTag extends AbstractContentTag implements MetadataContent, PhrasingContent, DisplayContents
|
||||||
|
{
|
||||||
|
const TAG = 'noscript';
|
||||||
|
}
|
156
src/Html5/Tags/ScriptTag.php
Normal file
156
src/Html5/Tags/ScriptTag.php
Normal file
|
@ -0,0 +1,156 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
|
use ByJoby\HTML\ContentCategories\PhrasingContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayNone;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContentTag;
|
||||||
|
|
||||||
|
class ScriptTag extends AbstractContentTag implements MetadataContent, PhrasingContent, DisplayNone
|
||||||
|
{
|
||||||
|
const TAG = 'noscript';
|
||||||
|
|
||||||
|
public function setAsync(bool $async): static
|
||||||
|
{
|
||||||
|
if ($async) $this->attributes()['async'] = null;
|
||||||
|
else unset($this->attributes()['async']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function async(): bool
|
||||||
|
{
|
||||||
|
return isset($this->attributes()['async']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDefer(bool $defer): static
|
||||||
|
{
|
||||||
|
if ($defer) $this->attributes()['defer'] = null;
|
||||||
|
else unset($this->attributes()['defer']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function defer(): bool
|
||||||
|
{
|
||||||
|
return isset($this->attributes()['defer']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function crossorigin(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['crossorigin'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setCrossorigin(null|string $crossorigin): static
|
||||||
|
{
|
||||||
|
$this->attributes()['crossorigin'] = $crossorigin;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetCrossorigin(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['crossorigin']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function integrity(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['integrity'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIntegrity(null|string $integrity): static
|
||||||
|
{
|
||||||
|
$this->attributes()['integrity'] = $integrity;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetIntegrity(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['integrity']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function nomodule(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['nomodule'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNomodule(null|string $nomodule): static
|
||||||
|
{
|
||||||
|
$this->attributes()['nomodule'] = $nomodule;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetNomodule(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['nomodule']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function nonce(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['nonce'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNonce(null|string $nonce): static
|
||||||
|
{
|
||||||
|
$this->attributes()['nonce'] = $nonce;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetNonce(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['nonce']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function referrerpolicy(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['referrerpolicy'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setReferrerpolicy(null|string $referrerpolicy): static
|
||||||
|
{
|
||||||
|
$this->attributes()['referrerpolicy'] = $referrerpolicy;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetReferrerpolicy(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['referrerpolicy']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function src(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['src'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSrc(null|string $src): static
|
||||||
|
{
|
||||||
|
$this->attributes()['src'] = $src;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetSrc(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['src']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function type(): null|string
|
||||||
|
{
|
||||||
|
return $this->attributes()['type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setType(null|string $type): static
|
||||||
|
{
|
||||||
|
$this->attributes()['type'] = $type;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unsetType(): static
|
||||||
|
{
|
||||||
|
unset($this->attributes()['type']);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
12
src/Html5/Tags/SectionTag.php
Normal file
12
src/Html5/Tags/SectionTag.php
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\SectioningContent;
|
||||||
|
use ByJoby\HTML\DisplayTypes\DisplayBlock;
|
||||||
|
use ByJoby\HTML\Tags\AbstractContainerTag;
|
||||||
|
|
||||||
|
class SectionTag extends AbstractContainerTag implements DisplayBlock, SectioningContent
|
||||||
|
{
|
||||||
|
const TAG = 'section';
|
||||||
|
}
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
namespace ByJoby\HTML\Html5\Tags;
|
namespace ByJoby\HTML\Html5\Tags;
|
||||||
|
|
||||||
|
use ByJoby\HTML\ContentCategories\MetadataContent;
|
||||||
use ByJoby\HTML\Tags\AbstractContentTag;
|
use ByJoby\HTML\Tags\AbstractContentTag;
|
||||||
|
|
||||||
class StyleTag extends AbstractContentTag
|
class StyleTag extends AbstractContentTag implements MetadataContent
|
||||||
{
|
{
|
||||||
const TAG = 'style';
|
const TAG = 'style';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue