LuhnTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A luhn() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of questocat/bank-card package.
5
 *
6
 * (c) questocat <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Questocat\BankCard;
13
14
trait LuhnTrait
15
{
16
    /**
17
     * @var Luhn
18
     */
19
    protected $luhn;
20
21
    /**
22
     * @return Luhn
23
     */
24
    public function luhn()
25
    {
26
        if (null === $this->luhn) {
27
            $this->luhn = new Luhn();
28
        }
29
30
        return $this->luhn;
31
    }
32
}
33