2022-06-27 15:55:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace D3\LinkmobilityClient\ValueObject;
|
|
|
|
|
|
|
|
use Phlib\SmsLength\SmsLength;
|
|
|
|
|
|
|
|
abstract class SmsMessageAbstract extends StringValueObject implements SmsMessageInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function chunkCount() : int
|
|
|
|
{
|
|
|
|
$smsLength = new SmsLength($this->value);
|
|
|
|
return $smsLength->getMessageCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function length() : int
|
|
|
|
{
|
|
|
|
$smsLength = new SmsLength($this->value);
|
|
|
|
return $smsLength->getSize();
|
|
|
|
}
|
|
|
|
|
2022-07-01 09:24:16 +02:00
|
|
|
public function getMessageContent() : string
|
2022-06-27 15:55:35 +02:00
|
|
|
{
|
|
|
|
return (string) $this->value;
|
|
|
|
}
|
|
|
|
}
|