Transaction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 12
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
    public function process(){
20
           echo 'Price =  '.$this->amount; 
21
22
    }
23
24
25
26
27
}
28
29
30
31
32
// class Transaction{
33
34
//     // private const STATUS_PAID = 'paid';
35
//     // private const STATUS_PENDING = 'pending';
36
37
//     private string $status = 'pending';
38
39
//    public function __construct()
40
//    {
41
//     $this->setStatus('pending');
42
//     // var_dump(self::STATUS_PAID);
43
    
44
//    }
45
46
//    public function setStatus(string $status):self
47
//    {
48
49
//     $this->status = $status;
50
51
//     return $status;
52
53
54
//    }
55
56
57
58
59
// }