Password   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 6 1
A validate() 0 7 1
1
<?php
2
3
namespace WeDevBr\Bankly\Types\Card;
4
5
use Illuminate\Contracts\Support\Arrayable;
6
use WeDevBr\Bankly\Validators\Card\PasswordValidator;
7
8
class Password extends \stdClass implements Arrayable
9
{
10
    /** @var string */
11
    public $password;
12
13
    /**
14
     * This validate and return an array
15
     * @return array
16
     */
17
    public function toArray(): array
18
    {
19
        $this->validate();
20
21
        return (array) $this;
22
    }
23
24
    /**
25
     * This function validate a card password
26
     */
27
    public function validate()
28
    {
29
        $validator = new PasswordValidator($this);
30
        $validator->validate();
31
32
        return $this;
33
    }
34
}
35