Passed
Push — master ( 6a587c...b0844f )
by Carl
04:24
created

Kyc   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 2
cbo 2
dl 0
loc 38
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A createDocument() 0 4 1
A submitDocument() 0 4 1
A createPage() 0 4 1
A getDocument() 0 4 1
1
<?php
2
/**
3
 * Created by Carl Owens ([email protected])
4
 * Company: PartFire Ltd (www.partfire.co.uk)
5
 * Copyright © 2016 PartFire Ltd. All rights reserved.
6
 *
7
 * User:    Carl Owens
8
 * Date:    06/12/2016
9
 * Time:    20:07
10
 * File:    Kyc.php
11
 **/
12
13
namespace PartFire\MangoPayBundle\Services;
14
15
use PartFire\MangoPayBundle\Models\DTOs\KycDocument;
16
use PartFire\MangoPayBundle\Models\DTOs\KycDocumentPage;
17
use PartFire\MangoPayBundle\Models\KycDocumentPageQueryInterface;
18
use PartFire\MangoPayBundle\Models\KycDocumentQueryInterface;
19
20
class Kyc
21
{
22
    protected $kycDocumentQuery;
23
24
    protected $kycDocumentPageQuery;
25
26
    public function __construct(
27
        KycDocumentQueryInterface $kycDocumentQuery,
28
        KycDocumentPageQueryInterface $kycDocumentPageQuery
29
    ) {
30
        $this->kycDocumentQuery = $kycDocumentQuery;
31
        $this->kycDocumentPageQuery = $kycDocumentPageQuery;
32
    }
33
34
    /**
35
     * @param KycDocument $kycDocument
36
     * @return mixed
37
     */
38
    public function createDocument(KycDocument $kycDocument)
39
    {
40
        return $this->kycDocumentQuery->create($kycDocument, false);
41
    }
42
43
    public function submitDocument(KycDocument $kycDocument)
44
    {
45
        return $this->kycDocumentQuery->submit($kycDocument);
46
    }
47
48
    public function createPage(KycDocumentPage $kycDocumentPage)
49
    {
50
        return $this->kycDocumentPageQuery->create($kycDocumentPage);
51
    }
52
53
    public function getDocument(int $kycDocumentId)
0 ignored issues
show
Unused Code introduced by
The parameter $kycDocumentId is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
54
    {
55
        return $this->kycDocumentPageQuery->get($kycDocument);
0 ignored issues
show
Bug introduced by
The variable $kycDocument does not exist. Did you mean $kycDocumentId?

This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.

The variable may have been renamed without also renaming all references.

Loading history...
Bug introduced by
The method get() does not seem to exist on object<PartFire\MangoPay...mentPageQueryInterface>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
56
    }
57
}
58