Completed
Push — master ( 879b99...0942ba )
by Luis Andrés
01:13 queued 11s
created

PersonalIdentification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Luilliarcec\LaravelEcuadorIdentification\Support\Identifications;
5
6
7
use Luilliarcec\LaravelEcuadorIdentification\Contracts\IdentificationContract;
8
use Luilliarcec\LaravelEcuadorIdentification\Exceptions\EcuadorIdentificationException;
9
10
class PersonalIdentification extends EcuadorValidations implements IdentificationContract
11
{
12
    /**
13
     * PersonalIdentification constructor.
14
     */
15
    public function __construct()
16
    {
17
        parent::__construct();
18
19
        $this->lenght = config('laravel-ecuador-identification.type-identifications.personal-identification.length');
0 ignored issues
show
Documentation Bug introduced by
It seems like config('laravel-ecuador-...identification.length') of type * is incompatible with the declared type array of property $lenght.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
20
        $this->billingCode = config('laravel-ecuador-identification.type-identifications.personal-identification.billing-code');
0 ignored issues
show
Documentation Bug introduced by
It seems like config('laravel-ecuador-...fication.billing-code') of type * is incompatible with the declared type array of property $billingCode.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
21
    }
22
23
    /**
24
     * Validate this identification
25
     *
26
     * @param string $number
27
     * @return \Illuminate\Config\Repository|mixed|string
28
     * @throws EcuadorIdentificationException
29
     */
30
    public function validate(string $number)
31
    {
32
        try {
33
            $this->validateInitial($number, $this);
34
            $this->moduleTen($number);
35
        } catch (EcuadorIdentificationException $e) {
36
            throw new EcuadorIdentificationException($e->getMessage());
37
        }
38
39
        return $this->billingCode;
40
    }
41
}
42