bootstrap fake sms from cli

This commit is contained in:
2022-06-13 14:01:07 +02:00
parent 9e4fd6183e
commit 616be5cc8a
15 changed files with 417 additions and 2 deletions

View File

@@ -196,6 +196,7 @@ class ChillMainExtension extends Extension implements
$loader->load('services/search.yaml');
$loader->load('services/serializer.yaml');
$loader->load('services/mailer.yaml');
$loader->load('services/short_message.yaml');
$this->configureCruds($container, $config['cruds'], $config['apis'], $loader);
}

View File

@@ -0,0 +1,10 @@
<?php
namespace Chill\MainBundle\Service\ShortMessage;
class NullShortMessageSender implements ShortMessageSenderInterface
{
public function send(ShortMessage $shortMessage): void
{
}
}

View File

@@ -0,0 +1,55 @@
<?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;
use libphonenumber\PhoneNumber;
class ShortMessage
{
private string $content;
private PhoneNumber $phoneNumber;
public function __construct(string $content, PhoneNumber $phoneNumber)
{
$this->content = $content;
$this->phoneNumber = $phoneNumber;
}
public function getContent(): string
{
return $this->content;
}
public function getPhoneNumber(): PhoneNumber
{
return $this->phoneNumber;
}
/**
* @param string $content
*/
public function setContent(string $content): void
{
$this->content = $content;
}
/**
* @param PhoneNumber $phoneNumber
*/
public function setPhoneNumber(PhoneNumber $phoneNumber): void
{
$this->phoneNumber = $phoneNumber;
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace Chill\MainBundle\Service\ShortMessage;
interface ShortMessageSenderInterface
{
public function send(ShortMessage $shortMessage): void;
}

View File

@@ -26,6 +26,7 @@ services:
tags:
- { name: 'doctrine.event_subscriber' }
# workflow related
Chill\MainBundle\Workflow\:
resource: '../Workflow/'

View File

@@ -0,0 +1,5 @@
services:
Chill\MainBundle\Service\ShortMessage\:
resource: '../Service/ShortMessage'
autowire: true
autoconfigure: true