for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Queue;
use App\Facades\Mail;
use App\Model\User;
use Ronanchilvers\Foundation\Queue\Exception\FailedJobException;
use Ronanchilvers\Foundation\Queue\Job\Job;
/**
* Base job for sending user emails
*
* @author Ronan Chilvers <[email protected]>
*/
abstract class UserMailJob extends Job
{
* @var string
protected $queue = 'emails';
protected $emailClass = null;
* @var App\Model\User
App\Queue\App\Model\User
App\Model\User
\
protected $user;
* @var array
protected $internalProperties = [
'delay',
'queue',
'emailClass'
];
* Class constructor
public function __construct(
User $user,
) {
$this->user = $user;
$user
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..
}
* {@inheritdoc}
public function execute()
$class = $this->emailClass;
$mail = new $class(
$this->user
);
if (!Mail::send($mail)) {
send()
App\Facades\Mail
__callStatic
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
if (!Mail::/** @scrutinizer ignore-call */ send($mail)) {
throw new FailedJobException('Unable to send User email : ' . $class);