| Total Complexity | 10 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | class Transferencia { |
||
| 7 | |||
| 8 | public $http; |
||
| 9 | |||
| 10 | public function __construct(Connection $connection) |
||
| 13 | } |
||
| 14 | |||
| 15 | |||
| 16 | public function getAll($parametos = false){ |
||
| 17 | $filtro = ''; |
||
| 18 | if(is_array($parametos)){ |
||
| 19 | if($parametos){ |
||
|
|
|||
| 20 | foreach($parametos as $key => $f){ |
||
| 21 | if(!empty($f)){ |
||
| 22 | if($filtro){ |
||
| 23 | $filtro .= '&'; |
||
| 24 | } |
||
| 25 | $filtro .= $key.'='.$f; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | $filtro = '?'.$filtro; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | return $this->http->get('/transfers/'.$filtro); |
||
| 32 | //https://www.asaas.com/api/v3/subscriptions/id/invoices?offset=&limit=&status= |
||
| 33 | } |
||
| 34 | |||
| 35 | public function consultaSaldo(){ |
||
| 36 | return $this->http->get('/finance/getCurrentBalance'); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function consultaWalletId(){ |
||
| 40 | return $this->http->get('/wallets'); |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | public function conta($dadosConta){ |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.