Method handle
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
parent::handle();
// get last known mail ID to detect when parity has been reached
Avoid using static access to class '\Seat\Eveapi\Models\Mail\MailRecipient' in method 'handle'. Open
MailRecipient::firstOrCreate([
'mail_id' => $header->mail_id,
'recipient_id' => $recipient->recipient_id,
'recipient_type' => $recipient->recipient_type,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Seat\Eveapi\Models\Mail\MailBody' in method 'handle'. Open
MailBody::firstOrCreate([
'mail_id' => $header->mail_id,
], [
'body' => $body->getBody()->body,
]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Seat\Eveapi\Models\Mail\MailRecipient' in method 'handle'. Open
MailRecipient::updateOrCreate([
'mail_id' => $header->mail_id,
'recipient_id' => $this->getCharacterId(),
'recipient_type' => 'character',
], [
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Seat\Eveapi\Models\Mail\MailHeader' in method 'handle'. Open
$mail_header = MailHeader::firstOrCreate([
'mail_id' => $header->mail_id,
], [
'subject' => $header->subject,
'from' => $header->from,
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}