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

String2LocalDate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 2
dl 0
loc 20
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 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