BankAccounts::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
/**
3
 * Created by Carl Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Copyright © 2017 PartFire Ltd. All rights reserved.
6
 *
7
 * User:    Carl Owens
8
 * Date:    19/01/2017
9
 * Time:    23:18
10
 * File:    BankAccounts.php
11
 **/
12
13
namespace PartFire\MangoPayBundle\Services;
14
15
use PartFire\MangoPayBundle\Models\BankAccountQueryInterface;
16
use PartFire\MangoPayBundle\Models\DTOs\AbstractBankAccount;
17
use PartFire\MangoPayBundle\Models\DTOs\GbBankAccount;
18
use PartFire\MangoPayBundle\Models\DTOs\IbanBankAccount;
19
20
class BankAccounts
21
{
22
    /**
23
     * @var BankAccountQueryInterface
24
     */
25
    private $bankAccountQuery;
26
27
    public function __construct(BankAccountQueryInterface $bankAccountQuery)
28
    {
29
        $this->bankAccountQuery = $bankAccountQuery;
30
    }
31
32
    /**
33
     * @param IbanBankAccount $ibanBankAccount
34
     * @return IbanBankAccount
35
     */
36
    public function createIbanBankAccount(IbanBankAccount $ibanBankAccount) : IbanBankAccount
37
    {
38
        return $this->bankAccountQuery->createIbanBankAccount($ibanBankAccount);
39
    }
40
41
    /**
42
     * @param GbBankAccount $gbBankAccount
43
     * @return GbBankAccount
44
     */
45
    public function createGbBankAccount(GbBankAccount $gbBankAccount) : GbBankAccount
46
    {
47
        return $this->bankAccountQuery->createGbBankAccount($gbBankAccount);
48
    }
49
50
    /**
51
     * @param $userId
52
     * @param $bankAccountId
53
     * @return bool
54
     */
55
    public function deactivate($userId, $bankAccountId) : bool
56
    {
57
        return $this->bankAccountQuery->deactivate($userId, $bankAccountId);
58
    }
59
60
    /**
61
     * @param $userId
62
     * @param $bankAccountId
63
     * @return AbstractBankAccount
64
     */
65
    public function get($userId, $bankAccountId) : AbstractBankAccount
66
    {
67
        return $this->bankAccountQuery->get($userId, $bankAccountId);
68
    }
69
}
70