Recipient   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 14
c 2
b 0
f 0
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A newFactory() 0 3 1
A getTaxId() 0 3 1
A getName() 0 3 1
A invoice() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Squareetlabs\VeriFactu\Models;
6
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\SoftDeletes;
9
use Illuminate\Database\Eloquent\Factories\HasFactory;
10
use Squareetlabs\VeriFactu\Contracts\VeriFactuRecipient;
11
12
class Recipient extends Model implements VeriFactuRecipient
13
{
14
    use HasFactory;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Database\Eloquent\Factories\HasFactory requires the property $factoryClass which is not provided by Squareetlabs\VeriFactu\Models\Recipient.
Loading history...
15
    use SoftDeletes;
16
17
    protected static function newFactory()
18
    {
19
        return \Database\Factories\Squareetlabs\VeriFactu\Models\RecipientFactory::new();
20
    }
21
22
    protected $table = 'recipients';
23
24
    protected $fillable = [
25
        'invoice_id',
26
        'name',
27
        'tax_id',
28
        'country',
29
        'id_type', // New field from PR #8 for foreign recipients
30
        // Otros campos relevantes
31
    ];
32
33
    public function invoice()
34
    {
35
        return $this->belongsTo(Invoice::class);
36
    }
37
38
    // VeriFactuRecipient Contract Implementation
39
40
    public function getName(): string
41
    {
42
        return $this->name;
43
    }
44
45
    public function getTaxId(): ?string
46
    {
47
        return $this->tax_id;
48
    }
49
}