diff options
author | n-peugnet <n.peugnet@free.fr> | 2020-04-08 16:06:41 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2020-04-08 16:06:41 +0200 |
commit | ef4d9d383a92a6759ee6e6b2961d5b8e1b9f5db6 (patch) | |
tree | ed95ee51af8910e0c13862dcd842fd0f6e194635 /app/class/Header.php | |
parent | b49830232096951202688bd775193424880bbd11 (diff) | |
download | wcms-ef4d9d383a92a6759ee6e6b2961d5b8e1b9f5db6.tar.gz wcms-ef4d9d383a92a6759ee6e6b2961d5b8e1b9f5db6.zip |
fix: SUMMARY produces invalid HTML code
- add new Header class to pass clean data structures.
- store all headers in the same array.
(not anymore grouped by element)
- modify sumparser to produce valid HTML.
Fixes #81
Diffstat (limited to 'app/class/Header.php')
-rw-r--r-- | app/class/Header.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/class/Header.php b/app/class/Header.php new file mode 100644 index 0000000..0165e59 --- /dev/null +++ b/app/class/Header.php @@ -0,0 +1,24 @@ +<?php + +namespace Wcms; + +/** + * Simple "c struct like" class that represent a Header's datas. + * All members are public because there is no logic in this class. It is only + * used to pass data from one element to another with cleanly typed members. + */ +class Header +{ + /** @var string $id the id of this header. */ + public $id; + /** @var int $level the level of deepness of this header. */ + public $level; + /** @var string $title the title displayed by this header. */ + public $title; + + public function __construct(string $id, int $level, string $title) { + $this->id = $id; + $this->level = $level; + $this->title = $title; + } +} |