for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\Line;
use LINE\LINEBot\Constant\MessageType;
use LINE\LINEBot\MessageBuilder;
use NotificationChannels\Line\Exceptions\CouldNotSendNotification;
class LineMessage implements MessageBuilder
{
/** @var string[] */
private $texts;
/** @var array */
private $message = [];
public function __construct($text, $extraTexts = null)
$extra = [];
if (! is_null($extraTexts)) {
$args = func_get_args();
$extra = array_slice($args, 1);
}
if (count($extra) >= 4) {
throw CouldNotSendNotification::exceededOfMessages(count($extra) + 1);
$this->texts = array_merge([$text], $extra);
array_merge(array($text), $extra)
array
array<integer,string>
$texts
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
/**
* Builds text message structure.
*/
public function buildMessage() : array
if (!empty($this->message)) {
return $this->message;
foreach ($this->texts as $text) {
$this->message[] = [
'type' => MessageType::TEXT,
'text' => $text,
];
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..