Intraface_Amount::convert2db()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
ccs 5
cts 5
cp 1
crap 1
1
<?php
2
/**
3
 * Bruges til at konvertere bel�b til og fra database
4
 * B�r den ikke kunne bruges de enkelte funktioner
5
 * direkte. Det vil i hvert fald g�re den mere anvendelig
6
 * i selve processen?
7
 * @author Sune
8
 * @version 001
9
 */
10
class Intraface_Amount
11
{
12
    private $amount;
13
14
    /**
15
     * indskriv det bel�b det drejer sig om
16
     * @param amount double bel�b
17
     */
18 88
    function __construct($amount)
19
    {
20 88
        $this->amount = $amount;
21 88
    }
22
23
    /**
24
     * Public: Konvertere et dansk bel�b til engelsk
25
     * B�r der ikke v�re noget der validerer?
26
     * @return 1
0 ignored issues
show
Documentation introduced by
The doc-type 1 could not be parsed: Unknown type name "1" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
27
     */
28 88
    function convert2db()
29
    {
30 88
        $this->amount = str_replace(".", "", $this->amount);
31 88
        $this->amount = str_replace(",", ".", $this->amount);
32 88
        settype($this->amount, "double");
33 88
        return true;
34
    }
35
36
37
    /**
38
     * Public: konvertere et engelsk bel�b til et dansk
39
     * B�r vist skrives om. Den returnerer jo 1 uanset?
40
     * @ return 1
41
     */
42
    function convert2dk()
43
    {
44
        //if (is_double($this->amount)) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
45
            $this->amount = number_format($this->amount, 2, ",", ".");
46
        //}
47
        return true;
48
    }
49
50
    /**
51
     * Public: henter bel�bet efter konvertering
52
     * @return bel�b
53
     */
54 88
    function get()
55
    {
56 88
        return($this->amount);
57
    }
58
}
59