Skip to content

Commit

Permalink
autofix code style + two fixed errors setting the right exception cla…
Browse files Browse the repository at this point in the history
…ss file
  • Loading branch information
rikterbeek committed Dec 11, 2018
1 parent 305271e commit 165cb2b
Show file tree
Hide file tree
Showing 126 changed files with 570 additions and 552 deletions.
9 changes: 5 additions & 4 deletions AdminMessage/CronMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function isDisplayed()
} else {
return false;
}

}

/**
Expand All @@ -93,8 +92,11 @@ public function getText()
$message = __('You have ' . $this->_cronCheck . ' unprocessed notification(s). Please check your Cron');
$urlMagento = "http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html";
$urlAdyen = "https://docs.adyen.com/developers/plug-ins-and-partners/magento/magento-2/configuring-the-adyen-plug-in";
$message .= __(' and visit <a href="%1">Magento DevDocs</a> and <a href="%2">Adyen Docs</a> on how to configure Cron.',
$urlMagento, $urlAdyen);
$message .= __(
' and visit <a href="%1">Magento DevDocs</a> and <a href="%2">Adyen Docs</a> on how to configure Cron.',
$urlMagento,
$urlAdyen
);
$message .= __('<i> Last cron check was: %1</i> ', $this->_dateChecked->format('d/m/Y H:i:s'));
return __($message);
}
Expand Down Expand Up @@ -125,4 +127,3 @@ public function getSessionData($key, $remove = false)
return $this->_authSession->getData($key, $remove);
}
}

8 changes: 2 additions & 6 deletions AdminMessage/VersionMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,17 @@ public function isDisplayed()
{
// Only execute the query the first time you access the Admin page
if ($this->_authSession->isFirstPageAfterLogin()) {

try {
$githubContent = $this->getDecodedContentFromGithub();
$this->setSessionData("AdyenGithubVersion", $githubContent);
$title = "Adyen extension version " . $githubContent['tag_name'] . " available!";
$versionData[] = array(
$versionData[] = [
'severity' => self::SEVERITY_NOTICE,
'date_added' => $githubContent['published_at'],
'title' => $title,
'description' => $githubContent['body'],
'url' => $githubContent['html_url'],
);
];

/*
* The parse function checks if the $versionData message exists in the inbox,
Expand All @@ -95,7 +94,6 @@ public function isDisplayed()
}
}
return false;

}

/**
Expand Down Expand Up @@ -150,6 +148,4 @@ public function getSessionData($key, $remove = false)
{
return $this->_authSession->getData($key, $remove);
}

}

1 change: 0 additions & 1 deletion Api/AdyenPaymentMethodManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ interface AdyenPaymentMethodManagementInterface
* @return \Magento\Checkout\Api\Data\PaymentDetailsInterface
*/
public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null);

}
4 changes: 1 addition & 3 deletions Api/AdyenRequestMerchantSessionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@

namespace Adyen\Payment\Api;


interface AdyenRequestMerchantSessionInterface
{

/**
* @return mixed
*/
public function getMerchantSession();

}
}
3 changes: 1 addition & 2 deletions Api/Data/InvoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,4 @@ public function getInvoiceId();
* @return $this
*/
public function setInvoiceId($invoiceId);

}
}
2 changes: 1 addition & 1 deletion Api/Data/NotificationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ public function getUpdatedAt();
* @return $this
*/
public function setUpdatedAt($timestamp);
}
}
3 changes: 1 addition & 2 deletions Api/Data/OrderPaymentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,4 @@ public function getUpdatedAt();
* @return $this
*/
public function setUpdatedAt($timestamp);

}
}
1 change: 0 additions & 1 deletion Api/GuestAdyenPaymentMethodManagementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ interface GuestAdyenPaymentMethodManagementInterface
* @return \Magento\Checkout\Api\Data\PaymentDetailsInterface
*/
public function getPaymentMethods($cartId, \Magento\Quote\Api\Data\AddressInterface $shippingAddress = null);

}
3 changes: 1 addition & 2 deletions Block/Adminhtml/System/Config/Field/Installments.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function getNumberOfInstallmentsRenderer()

/**
* Returns renderer for country element
*
*
* @return \Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes
*/
protected function getCcTypesRenderer()
Expand Down Expand Up @@ -114,7 +114,6 @@ protected function _prepareArrayRow(\Magento\Framework\DataObject $row)

$options = [];
if ($installlments) {

$options['option_' . $this->getNumberOfInstallmentsRenderer()->calcOptionHash($installlments)]
= 'selected="selected"';

Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Field/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ protected function _getElementHtml(\Magento\Framework\Data\Form\Element\Abstract
{
return $this->_adyenHelper->getModuleVersion();
}
}
}
2 changes: 1 addition & 1 deletion Block/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ public function getOrder()
}
return $this->_order;
}
}
}
6 changes: 2 additions & 4 deletions Block/Form/ApplePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Adyen\Payment\Helper\Data $adyenHelper,
array $data = []
)
{
) {
parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper;
}
Expand All @@ -60,5 +59,4 @@ public function getApplePayShippingTypes()
}
return $types;
}

}
}
3 changes: 1 addition & 2 deletions Block/Form/Boleto.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,4 @@ public function getBoletoTypes()
}
return $types;
}

}
}
5 changes: 2 additions & 3 deletions Block/Form/Cc.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Checkout\Model\Session $checkoutSession,
array $data = []
)
{
) {
parent::__construct($context, $paymentConfig);
$this->_adyenHelper = $adyenHelper;
$this->_appState = $context->getAppState();
Expand Down Expand Up @@ -110,4 +109,4 @@ public function hasVerification()
}
return true;
}
}
}
4 changes: 1 addition & 3 deletions Block/Form/Oneclick.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,4 @@ public function getOneClickCards()

return $cards;
}


}
}
4 changes: 1 addition & 3 deletions Block/Form/PayByMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ class PayByMail extends \Magento\Payment\Block\Form
* @var string
*/
protected $_template = 'Adyen_Payment::form/pay_by_mail.phtml';


}
}
1 change: 0 additions & 1 deletion Block/Form/PosCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ class PosCloud extends \Magento\Payment\Block\Form
* @var string
*/
protected $_template = 'Adyen_Payment::form/pos_cloud.phtml';

}
2 changes: 1 addition & 1 deletion Block/Form/Sepa.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public function getCountries()
{
return $this->_adyenHelper->getSepaCountries();
}
}
}
5 changes: 2 additions & 3 deletions Block/Info/AbstractInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ public function __construct(
\Adyen\Payment\Model\ResourceModel\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory,
Template\Context $context,
array $data = []
)
{
) {
parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper;
$this->_adyenOrderPaymentCollectionFactory = $adyenOrderPaymentCollectionFactory;
Expand All @@ -76,4 +75,4 @@ public function isDemoMode()
$storeId = $this->getInfo()->getOrder()->getStoreId();
return $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId);
}
}
}
2 changes: 1 addition & 1 deletion Block/Info/ApplePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@

class ApplePay extends Cc
{
}
}
1 change: 0 additions & 1 deletion Block/Info/Boleto.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ class Boleto extends AbstractInfo
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_boleto.phtml';

}
1 change: 0 additions & 1 deletion Block/Info/PayByMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ class PayByMail extends AbstractInfo
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_pay_by_mail.phtml';

}
1 change: 0 additions & 1 deletion Block/Info/Pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ class Pos extends AbstractInfo
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_pos.phtml';

}
1 change: 0 additions & 1 deletion Block/Info/PosCloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,4 @@ class PosCloud extends AbstractInfo
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_pos_cloud.phtml';

}
1 change: 0 additions & 1 deletion Block/Info/Sepa.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ class Sepa extends AbstractInfo
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_sepa.phtml';

}
19 changes: 9 additions & 10 deletions Block/Redirect/Pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,19 @@ public function getLaunchLink()
{
$launchlink = "";
try {
if ($this->_order->getPayment())
{

if ($this->_order->getPayment()) {
$realOrderId = $this->_order->getRealOrderId();
$orderCurrencyCode = $this->_order->getOrderCurrencyCode();
$amount = $this->_adyenHelper->formatAmount(
$this->_order->getGrandTotal(), $orderCurrencyCode
$this->_order->getGrandTotal(),
$orderCurrencyCode
);
$shopperEmail = $this->_order->getCustomerEmail();
$customerId = $this->_order->getCustomerId();
$callbackUrl = $this->_urlBuilder->getUrl('adyen/process/resultpos',
['_secure' => $this->_getRequest()->isSecure()]);
$callbackUrl = $this->_urlBuilder->getUrl(
'adyen/process/resultpos',
['_secure' => $this->_getRequest()->isSecure()]
);
$addReceiptOrderLines = $this->_adyenHelper->getAdyenPosConfigData("add_receipt_order_lines");
$recurringContract = $this->_adyenHelper->getAdyenPosConfigData('recurring_type');
$currencyCode = $orderCurrencyCode;
Expand Down Expand Up @@ -153,7 +154,7 @@ public function getLaunchLink()

$this->_adyenLogger->addAdyenDebug(print_r($launchlink, true));
}
} catch(Exception $e) {
} catch (Exception $e) {
// do nothing for now
throw($e);
}
Expand Down Expand Up @@ -232,7 +233,6 @@ protected function _getReceiptOrderLines(\Magento\Sales\Model\Order $order)
);
$myReceiptOrderLines .= " " . 1 . " " . $order->getShippingDescription() . "| " .
$currency . " " . $shippingAmountFormat ."|\n";

}

if ($order->getPaymentFeeAmount() > 0) {
Expand All @@ -243,7 +243,6 @@ protected function _getReceiptOrderLines(\Magento\Sales\Model\Order $order)
);
$myReceiptOrderLines .= " " . 1 . " " . $this->__('Payment Fee') . "| " .
$currency . " " . $paymentFeeAmount ."|\n";

}

$myReceiptOrderLines .= "|--------|\n".
Expand Down Expand Up @@ -282,4 +281,4 @@ protected function _getRequest()
{
return $this->_request;
}
}
}
Loading

0 comments on commit 165cb2b

Please sign in to comment.