Passed
Push — master ( ef93dc...4f7931 )
by
unknown
13:58
created

Code::__get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
cc 2
nc 2
nop 1
crap 2.0625
1
<?php
2
3
/*
4
 * This file is part of ibrand/laravel-sms.
5
 *
6
 * (c) iBrand <https://www.ibrand.cc>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace iBrand\Sms;
13
14
use Illuminate\Support\Collection;
15
16
/**
17
 * Class Code.
18
 */
19
class Code extends Collection
20
{
21
    /**
22
     * Code constructor.
23
     *
24
     * @param $to
25
     * @param $code
26
     * @param $sent
27
     * @param $attempts
28
     * @param $expireAt
29
     */
30 30
    public function __construct($to, $code, $sent, $attempts, $expireAt)
31
    {
32 30
        $items = compact('to', 'code', 'sent', 'attempts', 'expireAt');
33 30
        parent::__construct($items);
34 30
    }
35
36
    /**
37
     * Magic accessor.
38
     *
39
     * @param string $property property name
40
     *
41
     * @return mixed
42
     */
43 30
    public function __get($property)
44
    {
45 30
        if ($this->has($property)) {
46 30
            return $this->get($property);
47
        }
48
    }
49
}
50