Sort of working beta
This commit is contained in:
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\NotificationBody\Hellcase;
|
||||
|
||||
use App\Browser\Jobs\Hellcase\HellcaseLoginQrCode;
|
||||
use App\Notification\NotificationBody;
|
||||
|
||||
class HellcaseNotificationDailyFreeBody extends NotificationBody {
|
||||
|
||||
private string $content = "Vous avez remporté un cadeau gratuit sur Hellcase !";
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toMarkdownString(): string {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toString(): string {
|
||||
return $this->content;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\NotificationBody\Hellcase;
|
||||
|
||||
use App\Browser\Jobs\Hellcase\HellcaseLoginQrCode;
|
||||
use App\Notification\NotificationBody;
|
||||
|
||||
class HellcaseNotificationLoginBody extends NotificationBody {
|
||||
|
||||
private string $content = "Veuillez utiliser steam guard pour vous connecter à Hellcase.\nLe QR code se rafrachira toutes les ". HellcaseLoginQrCode::QR_CODE_VALIDITY ." secondes.";
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toMarkdownString(): string {
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toString(): string {
|
||||
return $this->content;
|
||||
}
|
||||
}
|
44
app/Notification/NotificationBody/ListNotificationBody.php
Normal file
44
app/Notification/NotificationBody/ListNotificationBody.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\NotificationBody;
|
||||
|
||||
use App\Notification\NotificationBody;
|
||||
use App\Notification\Stringifiable;
|
||||
|
||||
class ListNotificationBody extends NotificationBody {
|
||||
|
||||
private array $content;
|
||||
|
||||
public function __construct(array $content) {
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toMarkdownString(): string {
|
||||
$string = "";
|
||||
foreach ($this->content as $item) {
|
||||
$string .= "- ". $this->getTextFromContent($item) . "\n";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toString(): string {
|
||||
$string = "";
|
||||
foreach ($this->content as $item) {
|
||||
$string .= $this->getTextFromContent($item) . "\n";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function getTextFromContent(string|Stringifiable $content): string {
|
||||
if ($content instanceof Stringifiable) {
|
||||
return $content->toString();
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
32
app/Notification/NotificationBody/SimpleNotificationBody.php
Normal file
32
app/Notification/NotificationBody/SimpleNotificationBody.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Notification\NotificationBody;
|
||||
|
||||
use App\Notification\NotificationBody;
|
||||
use App\Notification\Stringifiable;
|
||||
|
||||
class SimpleNotificationBody extends NotificationBody {
|
||||
|
||||
private string $body;
|
||||
|
||||
public function __construct(string $body) {
|
||||
$this->body = $body;
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toMarkdownString(): string {
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
public function toHTMLString(): string {
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function toString(): string {
|
||||
return $this->body;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user