ImmutableValueImpl::revealArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php declare(strict_types=1);
2
namespace Kepawni\Twilted\Basic\TestSample;
3
4
use DateTime;
5
use InvalidArgumentException;
6
use Kepawni\Twilted\Basic\ImmutableValue;
7
8
/**
9
 * @property-read string $string
10
 * @property-read array $array
11
 * @property-read DateTime $dateTime
12
 * @property-read string $UpperCaseField
13
 * @method self withString(string $v)
14
 * @method self withArray(array $v)
15
 * @method self withDateTime(DateTime $v)
16
 * @method self withUpperCaseField(string $v)
17
 */
18
class ImmutableValueImpl extends ImmutableValue
19
{
20
    /**
21
     * ImmutableValueImpl constructor.
22
     * @param string $string
23
     * @param array $array
24
     * @param DateTime $dateTime
25
     * @param string $UpperCaseField
26
     * @throws InvalidArgumentException
27
     */
28
    public function __construct(string $string, array $array, DateTime $dateTime, string $UpperCaseField)
29
    {
30
        $this->init('string', $string);
31
        $this->init('array', $array);
32
        $this->init('dateTime', $dateTime);
33
        $this->init('UpperCaseField', $UpperCaseField);
34
    }
35
36
    public function revealArray()
37
    {
38
        return array_values((array)$this)[0];
39
    }
40
}
41