Client   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A apiCredential() 0 4 1
1
<?php
2
3
namespace Bytesfield\KeyManager\Models;
4
5
use Illuminate\Database\Eloquent\Factories\HasFactory;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Database\Eloquent\Relations\HasOne;
8
9
class Client extends Model
10
{
11
    use HasFactory;
12
13
    protected $guarded = [];
14
15
    protected $table = 'key_clients';
16
17
    /**
18
     * Get the api key for the related client.
19
     *
20
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
21
     */
22
    public function apiCredential(): HasOne
23
    {
24
        return $this->hasOne(ApiCredential::class, 'key_client_id');
25
    }
26
}
27