Updates to budgets.

This commit is contained in:
James Cole
2016-04-28 10:59:36 +02:00
parent 19d7e27fa9
commit b47a140c2f
20 changed files with 510 additions and 182 deletions

View File

@@ -3,7 +3,6 @@
namespace FireflyIII\Jobs;
use ErrorException;
use FireflyIII\User;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Message;
use Illuminate\Queue\InteractsWithQueue;
@@ -27,27 +26,29 @@ class MailError extends Job implements ShouldQueue
protected $exception;
/** @var string */
protected $ipAddress;
/** @var User */
protected $user;
/** @var array */
protected $userData;
/**
* MailError constructor.
*
* @param User $user
* @param array $userData
* @param string $destination
* @param string $ipAddress
* @param array $exceptionData
*
*/
public function __construct(User $user, string $destination, string $ipAddress, array $exceptionData)
public function __construct(array $userData, string $destination, string $ipAddress, array $exceptionData)
{
$this->user = $user;
$this->userData = $userData;
$this->destination = $destination;
$this->ipAddress = $ipAddress;
$this->exception = $exceptionData;
Log::debug('In mail job constructor for error handler.');
Log::error('Exception is: ' . json_encode($exceptionData));
$debug = $exceptionData;
unset($debug['stackTrace']);
Log::error('Exception is: ' . json_encode($debug));
}
/**
@@ -63,8 +64,8 @@ class MailError extends Job implements ShouldQueue
try {
$email = env('SITE_OWNER');
$args = $this->exception;
$args['loggedIn'] = !is_null($this->user->id);
$args['user'] = $this->user;
$args['loggedIn'] = $this->userData['id'] > 0;
$args['user'] = $this->userData;
$args['ip'] = $this->ipAddress;
Mail::send(