Passed
Push — main ( 1c458a...5a987a )
by Thierry
10:56 queued 05:26
created

PaymentService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getPayables() 0 7 1
1
<?php
2
3
namespace Siak\Tontine\Service\Payment;
4
5
use Illuminate\Support\Collection;
6
use Siak\Tontine\Model\Member;
7
use Siak\Tontine\Model\Session;
8
use Siak\Tontine\Service\Report\MemberService;
9
10
class PaymentService
11
{
12
    /**
13
     * @param MemberService $memberService
14
     */
15
    public function __construct(private MemberService $memberService)
16
    {}
17
18
    /**
19
     * @param Member $member
20
     * @param Session $session
21
     *
22
     * @return array<Collection>
23
     */
24
    public function getPayables(Member $member, Session $session): array
25
    {
26
        $receivables = $this->memberService->getReceivables($session, $member);
27
        $debts = $this->memberService->getDebts($session, $member);
28
        $bills = $this->memberService->getBills($session, $member);
29
30
        return [$receivables, $bills, $debts];
31
    }
32
}
33