Skip to content

Commit

Permalink
modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyraul committed May 15, 2024
1 parent fe365d4 commit fac18bb
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 104 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.1', '8.3']
php-versions: ['7.4', '8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
Expand All @@ -27,7 +28,7 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/nbproject/
.php_cs.cache
.php-cs-fixer.cache
/generated
8 changes: 4 additions & 4 deletions Console/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class Report extends Command
{
public const ARGUMENT = 'period';
public const ARGUMENT_DESCRIPTION = 'Period. Possible values: '
. self::TODAY_PERIOD . ', '
. self::YESTERDAY_PERIOD . ', '
. self::WEEK_PERIOD;
. self::TODAY_PERIOD . ', '
. self::YESTERDAY_PERIOD . ', '
. self::WEEK_PERIOD;
public const COMMAND = 'mygento:kkm:report';
public const COMMAND_DESCRIPTION = 'Show report of kkm transaction for period.';
public const WEEK_PERIOD = 'week';
Expand Down Expand Up @@ -74,7 +74,7 @@ public function __construct(
* @throws \Exception
* @return int
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->output = $output;

Expand Down
2 changes: 1 addition & 1 deletion Console/SendRefund.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function __construct(
* @throws \Mygento\Kkm\Exception\VendorBadServerAnswerException
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->appState->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL);

Expand Down
2 changes: 1 addition & 1 deletion Console/SendResell.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(
* @throws \Mygento\Kkm\Exception\VendorBadServerAnswerException
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->appState->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL);

Expand Down
2 changes: 1 addition & 1 deletion Console/SendSell.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct(
* @throws \Mygento\Kkm\Exception\VendorBadServerAnswerException
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->appState->setAreaCode(\Magento\Framework\App\Area::AREA_GLOBAL);

Expand Down
4 changes: 2 additions & 2 deletions Console/UpdateStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(
* @throws \Magento\Framework\Exception\LocalizedException
* @return int|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$transactionUuid = $input->getArgument(self::TRANSACTION_UUID_ARGUMENT);

Expand Down Expand Up @@ -138,7 +138,7 @@ protected function configure()
To update all transaction with status 'wait':
<comment>%command.full_name% </comment>
HELP
. self::RUN_ALL_PARAM
. self::RUN_ALL_PARAM
);
parent::configure();
}
Expand Down
8 changes: 4 additions & 4 deletions Model/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ private function collectStatistics($searchCriteriaBuilder)
)
->where(sprintf('%s.%s = %s', $salesOrderAlias, OrderInterface::STORE_ID, $this->storeId));
}
// $transactionAttempts = $this->attemptRepository->getList(
// $searchCriteriaBuilder->create()
// );
// $transactionAttempts = $this->attemptRepository->getList(
// $searchCriteriaBuilder->create()
// );

/** @var $statistics \Mygento\Kkm\Model\Statistics */
$statistics = $this->statisticsFactory->create();

// $items = array_merge($transactions->getItems(), $transactionAttempts->getItems());
// $items = array_merge($transactions->getItems(), $transactionAttempts->getItems());
$items = $transactions->getItems();
foreach ($items as $item) {
$info = $item->getAdditionalInformation(TransactionEntity::RAW_DETAILS);
Expand Down
6 changes: 3 additions & 3 deletions Plugin/ExtraSalesViewToolbarButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ private function canBeShownCheckStatusButton($transactions, $storeId)
foreach ($transactions as $transaction) {
$status = $transaction->getKkmStatus();
// может быть завршенная транзакция по предоплате
// if ($status === Response::STATUS_DONE) {
// return false;
// }
// if ($status === Response::STATUS_DONE) {
// return false;
// }
if ($status === Response::STATUS_WAIT) {
$isWait = true;
}
Expand Down
Loading

0 comments on commit fac18bb

Please sign in to comment.