Skip to content
Permalink
Browse files

ID#323: introduced type declaration for HTML header classes.

  • Loading branch information...
Christian Achatz
Christian Achatz committed May 17, 2018
1 parent e2a1c35 commit 8a3db017b3848a4fa8b7b0ef105ee0888ac11ff2
@@ -62,7 +62,7 @@ public function getChecksum();
* @version
* 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.
@@ -84,7 +84,7 @@ public function getPriority();
* @version
* 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.
@@ -52,7 +52,7 @@ public function getPriority() {
return $this->priority;
}
public function setPriority($priority) {
public function setPriority(int $priority) {
$this->priority = intval($priority); // normalize priority to 0 for all faulty inputs
return $this;
}
@@ -61,7 +61,7 @@ public function getAppendToBody() {
return $this->appendToBody;
}
public function setAppendToBody($value) {
public function setAppendToBody(bool $value) {
$this->appendToBody = $value;
return $this;
@@ -44,7 +44,7 @@ public function transform() {
$header = $this->getServiceObject(HtmlHeaderManager::class);
$node = new CssContentNode($this->getContent(), $this->getAttribute('media'));
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -46,7 +46,7 @@ public function transform() {
$type = $this->getAttribute('type');
$node = new CssImageNode($href, $rel, $type);
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -87,7 +87,7 @@ public function transform() {
$node = new DynamicCssNode(null, $namespace, $filename, $fcaction, $media);
}
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -49,7 +49,7 @@ public function transform() {
$node->setAppendToBody(true);
}
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -87,7 +87,7 @@ public function transform() {
$node->setAppendToBody(true);
}
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -55,7 +55,7 @@ public function transform() {
$node = new CssPackageNode($url, $name, $media);
}
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -48,7 +48,7 @@ public function transform() {
$node = new StaticCssNode($file, $this->getAttribute('media'));
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';
@@ -52,7 +52,7 @@ public function transform() {
$node->setAppendToBody(true);
}
$node->setPriority($this->getAttribute('priority'));
$node->setPriority(intval($this->getAttribute('priority')));
$header->addNode($node);
return '';

0 comments on commit 8a3db01

Please sign in to comment.
You can’t perform that action at this time.