| 1 |
<?php |
| 2 |
|
| 3 |
namespace Photonic_Plugin\Components; |
| 4 |
|
| 5 |
use Photonic_Plugin\Layouts\Core_Layout; |
| 6 |
use Photonic_Plugin\Platforms\Base; |
| 7 |
|
| 8 |
class Comment implements Printable { |
| 9 |
private string $message; |
| 10 |
|
| 11 |
/** |
| 12 |
* Error constructor. |
| 13 |
* |
| 14 |
* @param String $message |
| 15 |
*/ |
| 16 |
public function __construct(string $message) { |
| 17 |
$this->message = $message; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* {@inheritDoc} - an Error |
| 22 |
*/ |
| 23 |
public function html(Base $module, ?Core_Layout $layout, bool $print = false): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter |
| 24 |
$ret = " |
| 25 |
<!-- |
| 26 |
{$this->message} |
| 27 |
-->\n"; |
| 28 |
if ($print) { |
| 29 |
echo wp_kses_post($ret); |
| 30 |
} |
| 31 |
|
| 32 |
return wp_kses_post($ret); |
| 33 |
} |
| 34 |
} |
| 35 |
|