Passed
Push — master ( 4164b7...fac48b )
by Stavros
23:01 queued 07:51
created

Transaction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process() 0 2 1
1
<?php
2
3
// declare(strict_type = 1);
4
5
namespace App\VivaPayments;
6
7
// use App\VivaPayments\Enums\Status;
8
9
class Transaction
10
{
11
    private float $amount;
12
13
    public function __construct(float $amount)
14
    {
15
        $this->amount = $amount;
16
17
    }
18
19
20
21
22
    
23
24
    public function process(){
25
           echo 'Price =  '.$this->amount; 
26
27
    }
28
29
30
31
32
}
33
34
35
36
37
// class Transaction{
38
39
//     // private const STATUS_PAID = 'paid';
40
//     // private const STATUS_PENDING = 'pending';
41
42
//     private string $status = 'pending';
43
44
//    public function __construct()
45
//    {
46
//     $this->setStatus('pending');
47
//     // var_dump(self::STATUS_PAID);
48
    
49
//    }
50
51
//    public function setStatus(string $status):self
52
//    {
53
54
//     $this->status = $status;
55
56
//     return $status;
57
58
59
//    }
60
61
62
63
64
// }