for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace NotificationChannels\Textlocal;
class TextlocalMessage
{
/**
* The phone numbers copy of the message should be sent to.
*
* @var string
*/
public $cc = [];
* The sender the message should be sent from.
public $from;
* The time at which the message should be sent.
* @var string|number
public $at;
* The message content.
public $content;
* The Textlocal account through which the message should be sent.
public $account = 'promotional';
* Indication whether it's a test or not.
public $test = false;
* Create a new message instance.
* @param string $content
* @return void
public function __construct($content = '')
$this->content = $content;
}
* Set the message content.
* @return $this
public function content($content)
$this->content = trim($content);
return $this;
* Set the numbers copy of the message should be sent to.
* @param string|array $cc
public function cc($cc)
$cc = is_string($cc) ? [$cc] : $cc;
$this->cc = $cc;
$cc
array
array<integer,string>
string
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..
* Set the sender the message should be sent from.
* @param string $from
public function from($from)
$this->from = $from;
* Set the date and time at which the message should be sent.
* @param number $at
public function at($at)
$this->at = $at;
* Set the flag for test as true, for the message.
public function test()
$this->test = true;
$test
true
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
* Set Textlocal account from which the message should be sent as transactional.
public function transactional()
$this->account = 'transactional';
* Set Textlocal account from which the message should be sent as promotional.
public function promotional()
$this->account = 'promotional';
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..