getCode() returns string

This commit is contained in:
2021-04-02 22:47:11 +02:00
parent 40f0c7f76e
commit e47b6d3400
6 changed files with 6 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ abstract class Document {
return new $this->activeView($this);
}
function getCode() {
function getCode(): string {
if ($this->databaseRequired) {
$sql = $this->user->getSQL();

View File

@@ -68,7 +68,7 @@ abstract class Head extends View {
$this->addJS(Script::BOOTSTRAP);
}
public function getCode() {
public function getCode(): string {
$header = "<head>";
foreach($this->metas as $aMeta) {

View File

@@ -22,7 +22,7 @@ class Link extends StaticView {
$this->rel = $rel;
}
function getCode() {
function getCode(): string {
$type = (empty($this->type) ? "" : " type=\"$this->type\"");
return "<link rel=\"$this->rel\" href=\"$this->href\"$type/>";
}

View File

@@ -23,7 +23,7 @@ class Script extends StaticView {
$this->content = $content;
}
function getCode() {
function getCode(): string {
$src = (empty($this->src) ? "" : " src=\"$this->src\"");
return "<script type=\"$this->type\"$src>$this->content</script>";
}

View File

@@ -10,7 +10,7 @@ class Style extends StaticView {
$this->style = $style;
}
function getCode() {
function getCode(): string {
return "<style>$this->style</style>";
}
}