Skip to content

Commit

Permalink
Update discount.php to newest version & Added Gift Card support (#12)
Browse files Browse the repository at this point in the history
* Update Discount.php for M2 to the 1.1.15 v

* Fixed PHPCS Errors

* Fixed PHPMD Errors

* Update composer.json

* Update module.xml

* [INT-130] Update Discount.php and Added PhpUnitTests to module

* [INT-130] Run PhpUnit via Travis

* [INT-130] Downgrade phpUnit version

* [INT-130] Fixed codeSniffers

* [INT-130] Fixed codeStyle via Fixer

* [COL-16] Added Feature Gift Card support for Tax Inspection

* [COL-62] Updated travis & grumphp. Updated copyrights

* [COL-62] Removed unnecessary bootstrap.php
  • Loading branch information
Ruslan Mavlyanov authored and luckyraul committed Aug 14, 2018
1 parent 8e01a87 commit 5c815f2
Show file tree
Hide file tree
Showing 36 changed files with 5,909 additions and 204 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
phpunit.xml.dist export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.shippable.yml export-ignore
.scrutinizer.yml export-ignore
README.md export-ignore
version.xml export-ignore
magento.rb export-ignore
.php_cs export-ignore
grumphp.yml export-ignore
phpcs.xml export-ignore
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/nbproject
/node_modules
/.idea
/vendor
/composer.lock
.DS_Store
.DS_Store
.php_cs.cache
auth.json
61 changes: 61 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
$header = <<<EOF
@author Mygento Team
@copyright 2014-2018 Mygento (https://www.mygento.ru)
@package Mygento_Base
EOF;

$finder = PhpCsFixer\Finder::create()
->in('.')
->name('*.phtml')
->exclude('dev/tests/functional/generated')
->exclude('dev/tests/functional/var')
->exclude('dev/tests/functional/vendor')
->exclude('dev/tests/integration/tmp')
->exclude('dev/tests/integration/var')
->exclude('lib/internal/Cm')
->exclude('lib/internal/Credis')
->exclude('lib/internal/Less')
->exclude('lib/internal/LinLibertineFont')
->exclude('pub/media')
->exclude('pub/static')
->exclude('setup/vendor')
->exclude('var');

return PhpCsFixer\Config::create()
->setFinder($finder)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'include' => true,
'new_with_braces' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
// mygento
'header_comment' => ['header' => $header, 'commentType'=>'PHPDoc'],
'phpdoc_order' => true,
'phpdoc_types' => true,
'phpdoc_add_missing_param_annotation' => true,
'single_quote' => true,
'standardize_not_equals' => true,
'ternary_to_null_coalescing' => true,
'ternary_operator_spaces' => true,
'lowercase_cast' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'return_type_declaration' => true,
'no_useless_return' => true
]);
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ before_script:
- phpenv config-rm xdebug.ini
- composer install --no-interaction --prefer-dist
- php vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
- php vendor/bin/phpcs --config-set show_warnings 0

script:
- php vendor/bin/parallel-lint --exclude vendor .
- find . -path ./vendor -prune -o -name '*.xml' -print | xargs xmllint --noout
- php vendor/bin/phpcs .
- php vendor/bin/phpmd . text vendor/mygento/coding-standard/Mygento-Mage2/phpmd.xml --exclude vendor
- php vendor/bin/grumphp run

env:
global:
Expand Down
5 changes: 3 additions & 2 deletions Block/Adminhtml/Component/Edit/BackButton.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down
5 changes: 3 additions & 2 deletions Block/Adminhtml/Component/Edit/DeleteButton.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down
6 changes: 3 additions & 3 deletions Block/Adminhtml/Component/Edit/GenericButton.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/


namespace Mygento\Base\Block\Adminhtml\Component\Edit;

class GenericButton
Expand Down
5 changes: 3 additions & 2 deletions Block/Adminhtml/Component/Edit/ResetButton.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down
5 changes: 3 additions & 2 deletions Block/Adminhtml/Component/Edit/SaveAndContinueButton.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down
5 changes: 3 additions & 2 deletions Block/Adminhtml/Component/Edit/SaveButton.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down
7 changes: 4 additions & 3 deletions Block/Extensions.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down Expand Up @@ -172,8 +173,8 @@ protected function _getFieldRenderer()
/**
* Read info about extension from composer json file
* @param $moduleCode
* @return mixed
* @throws \Magento\Framework\Exception\FileSystemException
* @return mixed
*/
protected function _getModuleInfo($moduleCode)
{
Expand Down
7 changes: 4 additions & 3 deletions Helper/Currency.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down Expand Up @@ -47,8 +48,8 @@ public function __construct(
* @param $amountValue
* @param null $currencyCodeFrom
* @param null $currencyCodeTo
* @return float|int
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @return float|int
*/
public function convert($amountValue, $currencyCodeFrom = null, $currencyCodeTo = null)
{
Expand Down
8 changes: 5 additions & 3 deletions Helper/Data.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php

/**
* @author Mygento
* @copyright See COPYING.txt for license details.
* @author Mygento Team
* @copyright 2014-2018 Mygento (https://www.mygento.ru)
* @package Mygento_Base
*/

Expand Down Expand Up @@ -90,6 +91,7 @@ public function decrypt($path)
/**
*
* @param string $config_path
* @param mixed $configPath
* @return string
*/
public function getConfig($configPath)
Expand Down Expand Up @@ -125,7 +127,7 @@ public function requestApiGet($url, $data, $headers = [])
{
// @codingStandardsIgnoreStart
$curlh = curl_init();
curl_setopt($curlh, CURLOPT_URL, $url . "?" . http_build_query($data));
curl_setopt($curlh, CURLOPT_URL, $url . '?' . http_build_query($data));
curl_setopt($curlh, CURLOPT_POST, false);
curl_setopt($curlh, CURLOPT_HEADER, 0);
curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true);
Expand Down
Loading

0 comments on commit 5c815f2

Please sign in to comment.