Skip to content

Commit

Permalink
Apply cs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
gpupo committed Jan 11, 2019
1 parent 2e3aeef commit 6100d9c
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 52 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require-dev": {
"phpunit/phpunit": "^7.5.1",
"symfony/var-dumper": "^4.2.2",
"phpspec/prophecy": "~1.0|dev-master",
"phpspec/prophecy": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 3 additions & 3 deletions src/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ final class Client extends ClientAbstract implements ClientInterface
public function requestToken()
{
$pars = [
'grant_type' => 'client_credentials',
'client_id' => $this->getOptions()->get('client_id'),
'client_secret' => $this->getOptions()->get('client_secret'),
'grant_type' => 'client_credentials',
'client_id' => $this->getOptions()->get('client_id'),
'client_secret' => $this->getOptions()->get('client_secret'),
];

$this->setMode('form');
Expand Down
8 changes: 4 additions & 4 deletions src/Console/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function writeInfo(OutputInterface $output, $info, $tabs = '')
{
$tabs = $tabs."\t";
foreach ($info as $key => $value) {
if (is_array($value)) {
if (\is_array($value)) {
$output->writeln(sprintf($tabs.'<bg=green;fg=black> %s </>', $key));
$this->writeInfo($output, $value, $tabs);
} else {
Expand Down Expand Up @@ -122,9 +122,9 @@ protected function saveCredentials(array $data, OutputInterface $output)

if (!array_key_exists('refresh_token', $data)) {
$output->writeln([
'Warning: <bg=red>Offline App</>',
'- If your App has the option offline_access selected, you will receive a refresh_token along with the access_token',
'- refresh_token is <bg=red>not present</>',
'Warning: <bg=red>Offline App</>',
'- If your App has the option offline_access selected, you will receive a refresh_token along with the access_token',
'- refresh_token is <bg=red>not present</>',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Entity/Banking/BankingManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public function fillReport(EntityInterface $report)
$rac = new Record($translatedLine);
if ('initial_available_balance' === $rac->getRecordType()) {
$report->addExpand('initial_available_balance', $rac->getExpands());
} elseif (in_array($rac->getDescription(), ['withdrawal', 'reserve_for_payment'], true)) {
} elseif (\in_array($rac->getDescription(), ['withdrawal', 'reserve_for_payment'], true)) {
$report->addExpand($rac->getDescription(), $rac->getExpands());
} elseif (0 === $rac->getSourceId()) {
$errors['unknow'][] = $rac->getExpands();
} elseif (0 === (int)$rac->getGrossAmount()) {
} elseif (0 === (int) $rac->getGrossAmount()) {
$errors['gross_amount_zero'][] = $rac->getExpands();
} else {
$record = $this->factoryORM($rac, 'Entity\Banking\Report\Record');
Expand Down
6 changes: 2 additions & 4 deletions src/Entity/MovementManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@

namespace Gpupo\MercadopagoSdk\Entity;

use Gpupo\Common\Entity\ArrayCollection;

use Gpupo\CommonSchema\ArrayCollection\Banking\Movement\Movement as AC;
use Gpupo\CommonSchema\ORM\Entity\Banking\Movement\Movement;
use Gpupo\CommonSdk\Entity\Metadata\MetadataContainer;

class MovementManager extends GenericManager
Expand All @@ -45,8 +42,9 @@ public function getMovementList(): MetadataContainer
->setLimit($list['paging']['limit'])
->setTotalRows($list['paging']['total']);

if(!$list->getResults()){
if (!$list->getResults()) {
$collection->clear();

return $collection;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Entity/map/payment-translator-from-native.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'coupon_amount' => 'coupon_amount',
'issuer_id' => 'issuer_id',
'authorization_code' => 'authorization_code',
'shipping_amount' => 'shipping_cost'
'shipping_amount' => 'shipping_cost',
] as $origin => $destination) {
$foreign[$destination] = $native->get($origin);
}
Expand All @@ -46,7 +46,7 @@
$foreign['marketplace_fee'] = 0.0;

foreach ($native->getFeeDetails() as $fee) {
if (in_array($fee['type'], ['ml_fee', 'mp_fee', 'mercadopago_fee'])) {
if (in_array($fee['type'], ['ml_fee', 'mp_fee', 'mercadopago_fee'], true)) {
$foreign['marketplace_fee'] += $fee['amount'];
}
}
Expand Down
64 changes: 32 additions & 32 deletions src/Translator/map/translate.native.map.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
*/

$expands = [
'payer' => $native->get('payer'),
'external_reference' => $native->get('external_reference'),
'metadata' => $native->get('metadata'),
'transaction_amount_refunded' => $native->get('transaction_amount_refunded'),
'transaction_details' => $native->get('transaction_details'),
'money_release_date' => $native->get('money_release_date'),
'captured' => $native->get('captured'),
'card' => $native->get('card'),
'statement_descriptor' => $native->get('statement_descriptor'),
'notification_url' => $native->get('notification_url'),
'refunds' => $native->get('refunds'),
'order' => $native->get('order'),
];
'payer' => $native->get('payer'),
'external_reference' => $native->get('external_reference'),
'metadata' => $native->get('metadata'),
'transaction_amount_refunded' => $native->get('transaction_amount_refunded'),
'transaction_details' => $native->get('transaction_details'),
'money_release_date' => $native->get('money_release_date'),
'captured' => $native->get('captured'),
'card' => $native->get('card'),
'statement_descriptor' => $native->get('statement_descriptor'),
'notification_url' => $native->get('notification_url'),
'refunds' => $native->get('refunds'),
'order' => $native->get('order'),
];

$marketplaceFee = 0;
if ($native->get('fee_details')) {
Expand All @@ -38,25 +38,25 @@
}

$array = [
'operation_type' => $native->get('operation_type'),
'payment_number' => $native->get('id'),
'date_created' => $native->get('date_created'),
'date_approved' => $native->get('date_approved'),
'date_last_modified' => $native->get('date_last_updated'),
'operation_type' => $native->get('operation_type'),
'expands' => $expands,
'collector' => $native->get('collector'),
'reason' => $native->get('description'),
'marketplace_fee' => $marketplaceFee,
'currency_id' => $native->get('currency_id'),
'transaction_amount' => $native->get('transaction_details')['total_paid_amount'],
'status' => $native->get('status'),
'status_detail' => $native->get('status_detail'),
'authorization_code' => $native->get('call_for_authorize_id'),
'payment_method_id' => $native->get('payment_method_id'),
'issuer_id' => $native->get('issuer_id'),
'payment_type' => $native->get('payment_type_id'),
'installments' => $native->get('installments'),
'operation_type' => $native->get('operation_type'),
'payment_number' => $native->get('id'),
'date_created' => $native->get('date_created'),
'date_approved' => $native->get('date_approved'),
'date_last_modified' => $native->get('date_last_updated'),
'operation_type' => $native->get('operation_type'),
'expands' => $expands,
'collector' => $native->get('collector'),
'reason' => $native->get('description'),
'marketplace_fee' => $marketplaceFee,
'currency_id' => $native->get('currency_id'),
'transaction_amount' => $native->get('transaction_details')['total_paid_amount'],
'status' => $native->get('status'),
'status_detail' => $native->get('status_detail'),
'authorization_code' => $native->get('call_for_authorize_id'),
'payment_method_id' => $native->get('payment_method_id'),
'issuer_id' => $native->get('issuer_id'),
'payment_type' => $native->get('payment_type_id'),
'installments' => $native->get('installments'),
];

return $array;
4 changes: 2 additions & 2 deletions tests/Entity/MovementManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

namespace Gpupo\MercadopagoSdk\Tests\Entity;

use Gpupo\Common\Entity\ArrayCollection;
use Gpupo\Common\Entity\Collection;
use Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Payment\Payment;
use Gpupo\CommonSchema\ORM\Entity\Banking\Movement\Movement;
use Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Payment\Payment;
use Gpupo\MercadopagoSdk\Tests\TestCaseAbstract;
use Symfony\Component\Yaml\Yaml;
use Gpupo\Common\Entity\ArrayCollection;

/**
* @coversDefaultClass \Gpupo\MercadopagoSdk\Entity\MovementManager
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCaseAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ abstract class TestCaseAbstract extends CommonSdkTestCaseAbstract

public static function getResourcesPath()
{
return dirname(__DIR__).'/Resources/';
return \dirname(__DIR__).'/Resources/';
}

public static function getVarPath()
{
return dirname(__DIR__).'/var/';
return \dirname(__DIR__).'/var/';
}

public function factoryClient()
Expand Down

0 comments on commit 6100d9c

Please sign in to comment.