LuhnTrait::luhn()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
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