Skip to content

Commit

Permalink
ID#323: introduced type declaration for HTML header classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Achatz committed May 17, 2018
1 parent e2a1c35 commit 8a3db01
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions extensions/htmlheader/biz/HeaderNode.php
Expand Up @@ -62,7 +62,7 @@ public function getChecksum();
* @version * @version
* Version 0.1, 09.05.2011<br /> * Version 0.1, 09.05.2011<br />
*/ */
public function setPriority($priority); public function setPriority(int $priority);


/** /**
* Returns the priority defined for the current header node. * Returns the priority defined for the current header node.
Expand All @@ -84,7 +84,7 @@ public function getPriority();
* @version * @version
* Version 0.1, 21.09.2011<br /> * Version 0.1, 21.09.2011<br />
*/ */
public function setAppendToBody($value); public function setAppendToBody(bool $value);


/** /**
* Defines if the tag should be placed in gethead- or getjsbody taglib. * Defines if the tag should be placed in gethead- or getjsbody taglib.
Expand Down
4 changes: 2 additions & 2 deletions extensions/htmlheader/biz/HtmlNode.php
Expand Up @@ -52,7 +52,7 @@ public function getPriority() {
return $this->priority; return $this->priority;
} }


public function setPriority($priority) { public function setPriority(int $priority) {
$this->priority = intval($priority); // normalize priority to 0 for all faulty inputs $this->priority = intval($priority); // normalize priority to 0 for all faulty inputs
return $this; return $this;
} }
Expand All @@ -61,7 +61,7 @@ public function getAppendToBody() {
return $this->appendToBody; return $this->appendToBody;
} }


public function setAppendToBody($value) { public function setAppendToBody(bool $value) {
$this->appendToBody = $value; $this->appendToBody = $value;


return $this; return $this;
Expand Down
Expand Up @@ -44,7 +44,7 @@ public function transform() {
$header = $this->getServiceObject(HtmlHeaderManager::class); $header = $this->getServiceObject(HtmlHeaderManager::class);


$node = new CssContentNode($this->getContent(), $this->getAttribute('media')); $node = new CssContentNode($this->getContent(), $this->getAttribute('media'));
$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
Expand Up @@ -46,7 +46,7 @@ public function transform() {
$type = $this->getAttribute('type'); $type = $this->getAttribute('type');
$node = new CssImageNode($href, $rel, $type); $node = new CssImageNode($href, $rel, $type);


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
2 changes: 1 addition & 1 deletion extensions/htmlheader/pres/taglib/HtmlHeaderAddCssTag.php
Expand Up @@ -87,7 +87,7 @@ public function transform() {
$node = new DynamicCssNode(null, $namespace, $filename, $fcaction, $media); $node = new DynamicCssNode(null, $namespace, $filename, $fcaction, $media);
} }


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
Expand Up @@ -49,7 +49,7 @@ public function transform() {
$node->setAppendToBody(true); $node->setAppendToBody(true);
} }


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
2 changes: 1 addition & 1 deletion extensions/htmlheader/pres/taglib/HtmlHeaderAddJsTags.php
Expand Up @@ -87,7 +87,7 @@ public function transform() {
$node->setAppendToBody(true); $node->setAppendToBody(true);
} }


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
Expand Up @@ -55,7 +55,7 @@ public function transform() {
$node = new CssPackageNode($url, $name, $media); $node = new CssPackageNode($url, $name, $media);
} }


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
Expand Up @@ -48,7 +48,7 @@ public function transform() {


$node = new StaticCssNode($file, $this->getAttribute('media')); $node = new StaticCssNode($file, $this->getAttribute('media'));


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down
Expand Up @@ -52,7 +52,7 @@ public function transform() {
$node->setAppendToBody(true); $node->setAppendToBody(true);
} }


$node->setPriority($this->getAttribute('priority')); $node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node); $header->addNode($node);


return ''; return '';
Expand Down

0 comments on commit 8a3db01

Please sign in to comment.