These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Head; |
||
3 | |||
4 | use Redaxscript\Html; |
||
5 | |||
6 | /** |
||
7 | * children class to create the title tag |
||
8 | * |
||
9 | * @since 3.0.0 |
||
10 | * |
||
11 | * @package Redaxscript |
||
12 | * @category Head |
||
13 | * @author Henry Ruhs |
||
14 | * @author Balázs Szilágyi |
||
15 | */ |
||
16 | |||
17 | class Title implements HeadInterface |
||
18 | { |
||
19 | /** |
||
20 | * render the title |
||
21 | * |
||
22 | * @since 3.0.0 |
||
23 | * |
||
24 | * @param string $text |
||
25 | * |
||
26 | * @return string|null |
||
27 | */ |
||
28 | |||
29 | public function render(string $text = null) : ?string |
||
30 | { |
||
31 | if ($text) |
||
0 ignored issues
–
show
|
|||
32 | { |
||
33 | $titleElement = new Html\Element(); |
||
34 | return $titleElement |
||
35 | ->init('title') |
||
36 | 2 | ->text($text) |
|
37 | ->render(); |
||
38 | 2 | } |
|
39 | 2 | return null; |
|
40 | } |
||
41 | } |
||
42 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: