diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 24714834..946740a4 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -32,7 +32,7 @@ abstract class CSSList implements Renderable, Commentable { /** - * @var array $aComments + * @var array */ protected $aComments; @@ -57,10 +57,10 @@ public function __construct($iLineNo = 0) } /** - * @throws SourceException - * @throws UnexpectedTokenException - * * @return void + * + * @throws UnexpectedTokenException + * @throws SourceException */ public static function parseList(ParserState $oParserState, CSSList $oList) { @@ -451,6 +451,8 @@ public function getContents() /** * @param array $aComments + * + * @return void */ public function addComments(array $aComments) { @@ -467,6 +469,8 @@ public function getComments() /** * @param array $aComments + * + * @return void */ public function setComments(array $aComments) { diff --git a/src/Comment/Commentable.php b/src/Comment/Commentable.php index f9eb5e51..5e450bfb 100644 --- a/src/Comment/Commentable.php +++ b/src/Comment/Commentable.php @@ -5,17 +5,21 @@ interface Commentable { /** - * @param array $aComments Array of comments. + * @param array $aComments + * + * @return void */ public function addComments(array $aComments); /** - * @return array + * @return array */ public function getComments(); /** - * @param array $aComments Array containing Comment objects. + * @param array $aComments + * + * @return void */ public function setComments(array $aComments); } diff --git a/src/Property/CSSNamespace.php b/src/Property/CSSNamespace.php index 30957970..269ad2a1 100644 --- a/src/Property/CSSNamespace.php +++ b/src/Property/CSSNamespace.php @@ -2,6 +2,7 @@ namespace Sabberworm\CSS\Property; +use Sabberworm\CSS\Comment\Comment; use Sabberworm\CSS\OutputFormat; /** @@ -15,6 +16,9 @@ class CSSNamespace implements AtRule private $iLineNo; + /** + * @var array + */ protected $aComments; public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) @@ -89,16 +93,29 @@ public function atRuleArgs() return $aResult; } + /** + * @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; diff --git a/src/Property/Import.php b/src/Property/Import.php index beca0ff2..0bda7766 100644 --- a/src/Property/Import.php +++ b/src/Property/Import.php @@ -2,6 +2,7 @@ namespace Sabberworm\CSS\Property; +use Sabberworm\CSS\Comment\Comment; use Sabberworm\CSS\OutputFormat; use Sabberworm\CSS\Value\URL; @@ -26,7 +27,7 @@ class Import implements AtRule protected $iLineNo; /** - * @var array + * @var array */ protected $aComments; @@ -97,16 +98,29 @@ public function atRuleArgs() return $aResult; } + /** + * @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; diff --git a/src/Property/Selector.php b/src/Property/Selector.php index c0aad2a5..3aee4ac4 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -60,15 +60,30 @@ class Selector )$ /ux'; + /** + * @var string + */ private $sSelector; + /** + * @var int|null + */ private $iSpecificity; + /** + * @param string $sSelector + * + * @return bool + */ public static function isValid($sSelector) { return preg_match(static::SELECTOR_VALIDATION_RX, $sSelector); } + /** + * @param string $sSelector + * @param bool $bCalculateSpecificity + */ public function __construct($sSelector, $bCalculateSpecificity = false) { $this->setSelector($sSelector); @@ -77,22 +92,36 @@ public function __construct($sSelector, $bCalculateSpecificity = false) } } + /** + * @return string + */ public function getSelector() { return $this->sSelector; } + /** + * @param string $sSelector + * + * @return void + */ public function setSelector($sSelector) { $this->sSelector = trim($sSelector); $this->iSpecificity = null; } + /** + * @return string + */ public function __toString() { return $this->getSelector(); } + /** + * @return int + */ public function getSpecificity() { if ($this->iSpecificity === null) { diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 614ed6f7..78486814 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -2,6 +2,7 @@ namespace Sabberworm\CSS\RuleSet; +use Sabberworm\CSS\Comment\Comment; use Sabberworm\CSS\Comment\Commentable; use Sabberworm\CSS\OutputFormat; use Sabberworm\CSS\Parsing\ParserState; @@ -19,6 +20,9 @@ abstract class RuleSet implements Renderable, Commentable protected $iLineNo; + /** + * @var array + */ protected $aComments; public function __construct($iLineNo = 0) @@ -265,7 +269,9 @@ public function render(OutputFormat $oOutputFormat) } /** - * @param array $aComments Array of comments. + * @param array $aComments + * + * @return void */ public function addComments(array $aComments) { @@ -273,7 +279,7 @@ public function addComments(array $aComments) } /** - * @return array + * @return array */ public function getComments() { @@ -281,7 +287,9 @@ public function getComments() } /** - * @param array $aComments Array containing Comment objects. + * @param array $aComments + * + * @return void */ public function setComments(array $aComments) {