mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-09 16:24:59 +00:00
send message from cli through ovh if configured
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\ShortMessage;
|
||||
|
||||
class NullShortMessageSender implements ShortMessageSenderInterface
|
||||
|
@@ -19,10 +19,13 @@ class ShortMessage
|
||||
|
||||
private PhoneNumber $phoneNumber;
|
||||
|
||||
public function __construct(string $content, PhoneNumber $phoneNumber)
|
||||
private string $priority = 'low';
|
||||
|
||||
public function __construct(string $content, PhoneNumber $phoneNumber, string $priority = 'low')
|
||||
{
|
||||
$this->content = $content;
|
||||
$this->phoneNumber = $phoneNumber;
|
||||
$this->priority = $priority;
|
||||
}
|
||||
|
||||
public function getContent(): string
|
||||
@@ -35,21 +38,29 @@ class ShortMessage
|
||||
return $this->phoneNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent(string $content): void
|
||||
public function getPriority(): string
|
||||
{
|
||||
return $this->priority;
|
||||
}
|
||||
|
||||
public function setContent(string $content): self
|
||||
{
|
||||
$this->content = $content;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PhoneNumber $phoneNumber
|
||||
*/
|
||||
public function setPhoneNumber(PhoneNumber $phoneNumber): void
|
||||
public function setPhoneNumber(PhoneNumber $phoneNumber): self
|
||||
{
|
||||
$this->phoneNumber = $phoneNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPriority(string $priority): self
|
||||
{
|
||||
$this->priority = $priority;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\ShortMessage;
|
||||
|
||||
interface ShortMessageSenderInterface
|
||||
|
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\ShortMessage;
|
||||
|
||||
class ShortMessageTransporter implements ShortMessageTransporterInterface
|
||||
{
|
||||
private ShortMessageSenderInterface $sender;
|
||||
|
||||
public function __construct(
|
||||
ShortMessageSenderInterface $sender // hint: must remain at place 0 for DI
|
||||
) {
|
||||
$this->sender = $sender;
|
||||
}
|
||||
|
||||
public function send(ShortMessage $shortMessage): void
|
||||
{
|
||||
$this->sender->send($shortMessage);
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Service\ShortMessage;
|
||||
|
||||
interface ShortMessageTransporterInterface
|
||||
{
|
||||
public function send(ShortMessage $shortMessage);
|
||||
}
|
Reference in New Issue
Block a user