Skip to content

Commit fa6e70e

Browse files
committed
Convert from heredocs back to single quotes
1 parent a4489ac commit fa6e70e

File tree

1 file changed

+30
-41
lines changed

1 file changed

+30
-41
lines changed

src/Theme.php

+30-41
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ public function html(): string
2727

2828
extract($this->controller->output, EXTR_SKIP);
2929

30-
return <<<HTML
31-
<!DOCTYPE html>
32-
<html lang="en">
33-
<head>
34-
<meta charset="utf-8">
35-
<meta name="viewport" content="width=device-width, initial-scale=1">
36-
<title>{$doc}</title>{$css}
37-
</head>
38-
<body>{$log}{$nav1}{$head}{$main}{$foot}{$js}
39-
</body>
40-
</html>
41-
HTML;
30+
return '
31+
<!DOCTYPE html>
32+
<html lang="en">
33+
<head>
34+
<meta charset="utf-8">
35+
<meta name="viewport" content="width=device-width, initial-scale=1">
36+
<title>' . $doc . '</title>' . $css . '
37+
</head>
38+
<body>' . $head . $log . $nav1 . $main . $foot . $js . '
39+
</body>
40+
</html>';
4241
}
4342

4443
public function nav1(): string
@@ -61,9 +60,7 @@ public function nav_item(array $n): string
6160
$i = $n[2] ?? '';
6261
$i = $i ? "<i class=\"{$i}\"></i> " : '';
6362

64-
return <<<HTML
65-
<li class="nav-item{$c}"><a class="nav-link" href="{$n[1]}">{$i}{$n[0]}</a></li>
66-
HTML;
63+
return '<li class="nav-item' . $c . '"><a class="nav-link" href="' . $n[1] . '">' . $i . $n[0] . '</a></li>';
6764
}
6865

6966
public function nav_dropdown(array $a): string
@@ -75,12 +72,10 @@ public function nav_dropdown(array $a): string
7572

7673
$items = implode('', array_map(fn($n) => $this->nav_item($n), $a[1]));
7774

78-
return <<<HTML
79-
<li class="nav-item dropdown">
80-
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">{$i}{$a[0]}</a>
81-
<div class="dropdown-menu">{$items}</div>
82-
</li>
83-
HTML;
75+
return '<li class="nav-item dropdown">
76+
<a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown">' . $i . $a[0] . '</a>
77+
<div class="dropdown-menu">' . $items . '</div>
78+
</li>';
8479
}
8580

8681
public function list(array $items): string
@@ -100,16 +95,14 @@ public function list(array $items): string
10095
$content = htmlspecialchars($item['content'] ?? '');
10196
$plugin = $this->controller->input['plugin'];
10297

103-
$list .= <<<HTML
104-
<a href="?plugin={$plugin}&action=read&item={$id}" class="list-group-item">
105-
<h5>Item #{$id}</h5>
106-
<p>{$content}</p>
107-
<small>{$updated}</small>
108-
</a>
109-
HTML;
98+
$list .= '<a href="?plugin=' . $plugin . '&action=read&item=' . $id . '" class="list-group-item">
99+
<h5>Item #' . $id . '</h5>
100+
<p>' . $content . '</p>
101+
<small>' . $updated . '</small>
102+
</a>';
110103
}
111104

112-
return "<div class='list-group'>$list</div>";
105+
return '<div class="list-group">' . $list . '</div>';
113106
}
114107

115108
public function create(array $input): string
@@ -119,13 +112,11 @@ public function create(array $input): string
119112
$csrf = $_SESSION['csrf_token'] ?? '';
120113
$content = $input['content'] ?? '';
121114

122-
return <<<HTML
123-
<form method="post">
124-
<input type="hidden" name="csrf_token" value="{$csrf}">
125-
<textarea name="content">{$content}</textarea>
115+
return '<form method="post">
116+
<input type="hidden" name="csrf_token" value="' . $csrf . '">
117+
<textarea name="content">' . $content . '</textarea>
126118
<button type="submit">Create</button>
127-
</form>
128-
HTML;
119+
</form>';
129120
}
130121

131122
public function read(array $data): string
@@ -140,14 +131,12 @@ public function read(array $data): string
140131
$id = $data['id'] ?? '0';
141132
$content = htmlspecialchars($data['content'] ?? '');
142133

143-
return <<<HTML
144-
<div class="card">
134+
return '<div class="card">
145135
<div class="card-body">
146-
<h5>Item #{$id}</h5>
147-
<p>{$content}</p>
136+
<h5>Item #' . $id . '</h5>
137+
<p>' . $content . '</p>
148138
</div>
149-
</div>
150-
HTML;
139+
</div>';
151140
}
152141

153142
public function __toString(): string

0 commit comments

Comments
 (0)