Passed
Pull Request — master (#2)
by Oleksandr
12:21
created

InxmailToUtilDateTimeServiceBridge::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Inxmail\Dependency\Service;
9
10
class InxmailToUtilDateTimeServiceBridge implements InxmailToUtilDateTimeServiceInterface
11
{
12
    /**
13
     * @var \Spryker\Service\UtilDateTime\UtilDateTimeServiceInterface
14
     */
15
    protected $utilDateTimeService;
16
17
    /**
18
     * @param \Spryker\Service\UtilDateTime\UtilDateTimeServiceInterface $utilDateTimeService
19
     */
20
    public function __construct($utilDateTimeService)
21
    {
22
        $this->utilDateTimeService = $utilDateTimeService;
23
    }
24
25
    /**
26
     * @param \DateTime|string $date
27
     *
28
     * @return string
29
     */
30
    public function formatDate($date): string
31
    {
32
        return $this->utilDateTimeService->formatDate($date);
0 ignored issues
show
Bug introduced by
It seems like $date can also be of type DateTime; however, parameter $date of Spryker\Service\UtilDate...Interface::formatDate() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

32
        return $this->utilDateTimeService->formatDate(/** @scrutinizer ignore-type */ $date);
Loading history...
33
    }
34
35
    /**
36
     * @param \DateTime|string $date
37
     *
38
     * @return string
39
     */
40
    public function formatDateTime($date): string
41
    {
42
        return $this->utilDateTimeService->formatDateTime($date);
0 ignored issues
show
Bug introduced by
It seems like $date can also be of type DateTime; however, parameter $date of Spryker\Service\UtilDate...rface::formatDateTime() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
        return $this->utilDateTimeService->formatDateTime(/** @scrutinizer ignore-type */ $date);
Loading history...
43
    }
44
45
    /**
46
     * @param \DateTime|string $date
47
     *
48
     * @return string
49
     */
50
    public function formatTime($date): string
51
    {
52
        return $this->utilDateTimeService->formatTime($date);
0 ignored issues
show
Bug introduced by
It seems like $date can also be of type DateTime; however, parameter $date of Spryker\Service\UtilDate...Interface::formatTime() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

52
        return $this->utilDateTimeService->formatTime(/** @scrutinizer ignore-type */ $date);
Loading history...
53
    }
54
}
55