Completed
Push — 8.x ( 41ca52 )
by Tim
10:18
created

DateConverter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A getSourceDateFormat() 0 4 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Configuration\Jms\Configuration\DateConverter
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2016 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-configuration-jms
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Configuration\Jms\Configuration\Subject;
22
23
use JMS\Serializer\Annotation\Type;
24
use JMS\Serializer\Annotation\SerializedName;
25
use TechDivision\Import\Utils\DependencyInjectionKeys;
26
use TechDivision\Import\Configuration\Subject\DateConverterConfigurationInterface;
27
28
/**
29
 * A simple date converter configuration implementation.
30
 *
31
 * @author    Tim Wagner <[email protected]>
32
 * @copyright 2016 TechDivision GmbH <[email protected]>
33
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
34
 * @link      https://github.com/techdivision/import-configuration-jms
35
 * @link      http://www.techdivision.com
36
 */
37
class DateConverter implements DateConverterConfigurationInterface
38
{
39
40
    /**
41
     * The date converter's class name.
42
     *
43
     * @var string
44
     * @Type("string")
45
     */
46
    protected $id = DependencyInjectionKeys::IMPORT_SUBJECT_DATE_CONVERTER_SIMPLE;
47
48
    /**
49
     * The source date format to use.
50
     *
51
     * @var string
52
     * @Type("string")
53
     * @SerializedName("source-date-format")
54
     */
55
    protected $sourceDateFormat = 'n/d/y, g:i A';
56
57
    /**
58
     * Returns the date converter's unique DI identifier.
59
     *
60
     * @return string The date converter's unique DI identifier
61
     */
62
    public function getId()
63
    {
64
        return $this->id;
65
    }
66
67
    /**
68
     * Returns the source date format to use.
69
     *
70
     * @return string The source date format
71
     */
72
    public function getSourceDateFormat()
73
    {
74
        return $this->sourceDateFormat;
75
    }
76
}
77