1 | <?php |
||
20 | class Byline extends ViewAbstract |
||
21 | { |
||
22 | /** |
||
23 | * options of the byline |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | |||
28 | protected $_optionArray = |
||
29 | [ |
||
30 | 'className' => |
||
31 | [ |
||
32 | 'box' => 'rs-box-byline', |
||
33 | 'text' => |
||
34 | [ |
||
35 | 'by' => 'rs-text-by', |
||
36 | 'author' => 'rs-text-author', |
||
37 | 'on' => 'rs-text-on', |
||
38 | 'date' => 'rs-text-date', |
||
39 | 'at' => 'rs-text-at', |
||
40 | 'time' => 'rs-text-time', |
||
41 | ] |
||
42 | ] |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * init the class |
||
47 | * |
||
48 | * @since 4.0.0 |
||
49 | * |
||
50 | * @param array $optionArray options of the pagination |
||
51 | * |
||
52 | * @return self |
||
53 | */ |
||
54 | |||
55 | public function init(array $optionArray = []) : self |
||
60 | |||
61 | /** |
||
62 | * render the view |
||
63 | * |
||
64 | * @since 4.0.0 |
||
65 | * |
||
66 | * @param int $date timestamp of the date |
||
67 | * @param string $author name of the author |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | |||
72 | public function render(int $date = null, string $author = null) : string |
||
135 | } |
||
136 |
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: