Completed
Branch master (25a17b)
by Karsten
02:55
created

String2LocalDate::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * File was created 02.10.2015 11:35
4
 *
5
 * @author Karsten J. Gerber <[email protected]>
6
 */
7
namespace PeekAndPoke\Component\Psi\Functions\Unary\Mapper;
8
9
use PeekAndPoke\Component\Psi\Functions\Unary\AbstractParameterisedUnaryFunction;
10
use PeekAndPoke\Component\Psi\Interfaces\Functions\ValueHolderInterface;
11
use PeekAndPoke\Horizons\DateAndTime\LocalDate;
12
13
/**
14
 * String2LocalDate
15
 *
16
 * @author Karsten J. Gerber <[email protected]>
17
 */
18
class String2LocalDate extends AbstractParameterisedUnaryFunction
19
{
20
    /**
21
     * @param string|\DateTimeZone|ValueHolderInterface $timezone
22
     */
23 1
    public function __construct($timezone)
24
    {
25 1
        parent::__construct($timezone);
26 1
    }
27
28
    /**
29
     * @param mixed $input
30
     *
31
     * @return LocalDate
32
     */
33 1
    public function __invoke($input)
34
    {
35 1
        return new LocalDate($input, $this->getValue());
36
    }
37
}
38