MonnifyPaymentMethods::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created By: Henry Ejemuta
4
 * Project: laravel-monnify
5
 * Class Name: MonnifyPaymentMethods.php
6
 * Date Created: 7/15/20
7
 * Time Created: 12:42 AM
8
 */
9
10
namespace HenryEjemuta\LaravelMonnify\Classes;
11
12
13
class MonnifyPaymentMethods
14
{
15
16
    private $monnifyPaymentMethods = [];
17
18
    /**
19
     * MonnifyPaymentMethods constructor.
20
     * @param MonnifyPaymentMethod[] $monnifyPaymentMethods
21
     */
22
    public function __construct(MonnifyPaymentMethod ...$monnifyPaymentMethods)
23
    {
24
        foreach ($monnifyPaymentMethods as $method) {
25
            $this->monnifyPaymentMethods[$method->getID()] = $method->getMethod();
26
        }
27
    }
28
29
    public function toArray(): array
30
    {
31
        return array_values($this->monnifyPaymentMethods);
32
    }
33
}
34