From c9f46a7da2f97a40d482fd775ce4788b4c0d87d9 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sun, 27 Jun 2021 14:50:35 +0200 Subject: [PATCH] Add type annotations for `Charset` --- src/Property/Charset.php | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/Property/Charset.php b/src/Property/Charset.php index ea6be495..5c0c65fb 100644 --- a/src/Property/Charset.php +++ b/src/Property/Charset.php @@ -2,14 +2,16 @@ namespace Sabberworm\CSS\Property; +use Sabberworm\CSS\Comment\Comment; use Sabberworm\CSS\OutputFormat; /** - * Class representing an @charset rule. + * Class representing an `@charset` rule. + * * The following restrictions apply: - * • May not be found in any CSSList other than the Document. - * • May only appear at the very top of a Document’s contents. - * • Must not appear more than once. + * - May not be found in any CSSList other than the Document. + * - May only appear at the very top of a Document’s contents. + * - Must not appear more than once. */ class Charset implements AtRule { @@ -24,7 +26,7 @@ class Charset implements AtRule protected $iLineNo; /** - * @var array + * @var array */ protected $aComments; @@ -47,16 +49,27 @@ public function getLineNo() return $this->iLineNo; } + /** + * @param string $sCharset + * + * @return void + */ public function setCharset($sCharset) { $this->sCharset = $sCharset; } + /** + * @return string + */ public function getCharset() { return $this->sCharset; } + /** + * @return string + */ public function __toString() { return $this->render(new OutputFormat()); @@ -88,16 +101,29 @@ public function atRuleArgs() return $this->sCharset; } + /** + * @param array $aComments + * + * @return void + */ public function addComments(array $aComments) { $this->aComments = array_merge($this->aComments, $aComments); } + /** + * @return array + */ public function getComments() { return $this->aComments; } + /** + * @param array $aComments + * + * @return void + */ public function setComments(array $aComments) { $this->aComments = $aComments;