Completed
Push — symfony3-wololo-packages ( fecf70...6bf04d )
by Kamil
28:46 queued 11:35
created

FormatMoneyHelper   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A formatAmount() 0 4 1
A getName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\MoneyBundle\Templating\Helper;
13
14
use Sylius\Bundle\MoneyBundle\Formatter\MoneyFormatterInterface;
15
use Symfony\Component\Templating\Helper\Helper;
16
17
class FormatMoneyHelper extends Helper implements FormatMoneyHelperInterface
18
{
19
    /**
20
     * @var MoneyFormatterInterface
21
     */
22
    private $moneyFormatter;
23
24
    /**
25
     * @param MoneyFormatterInterface $moneyFormatter
26
     */
27
    public function __construct(MoneyFormatterInterface $moneyFormatter)
28
    {
29
        $this->moneyFormatter = $moneyFormatter;
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function formatAmount($amount, $currencyCode, $localeCode)
36
    {
37
        return $this->moneyFormatter->format($amount, $currencyCode, $localeCode);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getName()
44
    {
45
        return 'sylius_format_money';
46
    }
47
}
48