Test Failed
Push — master ( 7fb687...840826 )
by Gabriel
12:03
created

Money::getCurrencies()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ByTIC\Money\Utility;
4
5
use Money\Currency;
6
7
/**
8
 * Class Money
9
 * @package ByTIC\Money\Utility
10
 */
11
class Money
12
{
13
    /**
14
     * @param $value
15
     * @param null $currency
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $currency is correct as it would always require null to be passed?
Loading history...
16
     */
17
    public static function fromFloat($value, $currency = null)
18
    {
19
        $value = floatval($value);
20
        return \ByTIC\Money\Money::parse($value, $currency);
21
    }
22
23
    /**
24
     * @param $value
25
     * @param null $currency
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $currency is correct as it would always require null to be passed?
Loading history...
26
     * @deprecated use ByTIC\Money\Money::currency
27 2
     */
28
    public static function create($value, $currency = null)
29 2
    {
30 2
        $currency = \ByTIC\Money\Money::currency($currency);
31
        return \ByTIC\Money\Money::parseByDecimal($value, $currency);
32
    }
33
34
    /**
35
     * @param $code
36
     * @return Currency
37 2
     * @deprecated use ByTIC\Money\Money::currency
38
     */
39 2
    public static function currency($code = null)
40 2
    {
41
        return \ByTIC\Money\Money::currency($code);
42
    }
43
44
    /**
45
     * @return string
46 2
     * @deprecated use ByTIC\Money\Money::currencyDefault
47
     */
48 2
    public static function currencyDefault()
49
    {
50
        return \ByTIC\Money\Money::currencyDefault();
51
    }
52
53
    /**
54
     * Get currencies.
55
     *
56
     * @return \Money\Currencies
57
     * @deprecated use ByTIC\Money\Money::getCurrencies
58
     */
59
    public static function getCurrencies()
60
    {
61
        return \ByTIC\Money\Money::getCurrencies();
62
    }
63
}