GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 499efc...ba1b88 )
by Kivanio
02:06
created

BankBillet::duplicate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace BoletoSimples;
4
5
class BankBillet extends BaseResource {
6
  public function cancel() {
7
    $response = self::sendRequest('PUT', $this->path('cancel'));
0 ignored issues
show
Bug introduced by
The method sendRequest() does not exist on BoletoSimples\BankBillet. Did you maybe mean _sendRequest()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
8
    return $this->parseResponse($response);
9
  }
10
11
  public function duplicate($params = array()) {
12
    $response = self::sendRequest('POST', $this->path('duplicate'), ['query' => $params]);
0 ignored issues
show
Bug introduced by
The method sendRequest() does not exist on BoletoSimples\BankBillet. Did you maybe mean _sendRequest()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
13
    return $this->parseResponse($response);
14
  }
15
16 View Code Duplication
  public static function cnpj_cpf($cnpj_cpf) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
    if (!$cnpj_cpf) {
18
      throw new \Exception("Couldn't find ".get_called_class()." without an cnpj or cpf.");
19
    }
20
    $response = self::sendRequest('GET', 'bank_billets/cnpj_cpf', ['query' => ['q' => $cnpj_cpf]]);
0 ignored issues
show
Bug introduced by
The method sendRequest() does not exist on BoletoSimples\BankBillet. Did you maybe mean _sendRequest()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
21
    $collection = [];
22
    foreach ($response->json() as $attributes) {
23
      $collection[] = new BankBillet($attributes);
24
    }
25
    return $collection;
26
  }
27
28 View Code Duplication
  public static function status($status) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    if (!$status) {
30
      throw new \Exception("Couldn't find ".get_called_class()." without an status.");
31
    }
32
    $response = self::sendRequest('GET', 'bank_billets/status', ['query' => ['q' => $status]]);
0 ignored issues
show
Bug introduced by
The method sendRequest() does not exist on BoletoSimples\BankBillet. Did you maybe mean _sendRequest()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
33
    $collection = [];
34
    foreach ($response->json() as $attributes) {
35
      $collection[] = new BankBillet($attributes);
36
    }
37
    return $collection;
38
  }
39
40 View Code Duplication
  public static function our_number($our_number) {
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    if (!$our_number) {
42
      throw new \Exception("Couldn't find ".get_called_class()." without an our_number.");
43
    }
44
    $response = self::sendRequest('GET', 'bank_billets/our_number', ['query' => ['q' => $our_number]]);
0 ignored issues
show
Bug introduced by
The method sendRequest() does not exist on BoletoSimples\BankBillet. Did you maybe mean _sendRequest()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
45
    $collection = [];
46
    foreach ($response->json() as $attributes) {
47
      $collection[] = new BankBillet($attributes);
48
    }
49
    return $collection;
50
  }
51
}