Skip to content

Commit 0af6eec

Browse files
authored
Merge pull request #5 from MaximGns/bugfix/grumphp
Update grumphp and update code
2 parents 63149c6 + 7533465 commit 0af6eec

File tree

7 files changed

+36
-757
lines changed

7 files changed

+36
-757
lines changed

.github/workflows/grumphp.yml

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,27 @@ on: [push]
22

33
jobs:
44
build:
5-
name: Checking coding standards
5+
name: Running GrumPHP
66
runs-on: ubuntu-latest
7+
env:
8+
extensions: intl, mbstring
79
steps:
810
- uses: actions/checkout@v2
9-
- name: Get Composer Cache Directory
10-
id: composer-cache
11-
run: |
12-
echo "::set-output name=dir::$(composer config cache-files-dir)"
13-
14-
- name: Cache Composer Downloads
15-
uses: actions/cache@v1
11+
- name: Setup PHP
12+
uses: shivammathur/setup-php@v2
1613
with:
17-
path: ${{ steps.composer-cache.outputs.dir }}
18-
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
19-
restore-keys: |
20-
${{ runner.os }}-composer-
21-
22-
- name: Cache PHP dependencies
23-
uses: actions/cache@v1
24-
with:
25-
path: vendor
26-
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
27-
28-
- uses: MilesChou/composer-action@master
29-
with:
30-
args: config "http-basic.repo.magento.com" ${{ secrets.MAGE_USER }} ${{ secrets.MAGE_PASS }}
31-
32-
- uses: MilesChou/composer-action@master
14+
php-version: '7.3'
15+
extensions: ${{ env.extensions }}
16+
tools: composer
17+
- name: Get Composer Cache Directory
18+
id: composercache
19+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
20+
- name: Cache dependencies
21+
uses: actions/cache@v2
3322
with:
34-
args: install --prefer-dist
35-
23+
path: ${{ steps.composercache.outputs.dir }}
24+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
25+
restore-keys: ${{ runner.os }}-composer-
26+
- name: Install dependencies
27+
run: composer config "http-basic.repo.magento.com" ${{ secrets.MAGE_USER }} ${{ secrets.MAGE_PASS }} && composer install --prefer-dist
3628
- run: ./vendor/bin/grumphp run

Config/SystemConfiguration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Phpro\APILogger\Config;
46

57
use Phpro\LoggerHandler\Config\LogConfiguration;

Plugin/RestApiLog.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Phpro\APILogger\Plugin;
@@ -39,7 +40,8 @@ public function aroundDispatch(
3940
list($responseStatusCode, $responseBody) = $this->getResponseData($response);
4041

4142
$this->logger->info(sprintf(
42-
'[API LOGGER] [IP: "%s"] [Method: "%s"] [Endpoint: "%s"] [ResponseCode: "%s"] [Exec Time: %s] [Request Body: "%s"] [Response Body: "%s"]',
43+
'[API LOGGER] [IP: "%s"] [Method: "%s"] [Endpoint: "%s"] [ResponseCode: "%s"]' .
44+
'[Exec Time: %s] [Request Body: "%s"] [Response Body: "%s"]',
4345
$request->getClientIp(),
4446
$request->getMethod(),
4547
$request->getRequestUri(),

Setup/UpgradeData.php

Lines changed: 0 additions & 38 deletions
This file was deleted.

composer.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.0",
14+
"php": "^7.1",
1515
"magento/framework": "^100.1|^101.0|^102.0|^103.0",
1616
"phpro/mage2-module-logger-handler": "^3.0.0"
1717
},
1818
"require-dev": {
19-
"magento/marketplace-eqp": "^1.0",
20-
"phpro/grumphp": "^0.14"
19+
"phpro/grumphp-shim": "~1.5.0",
20+
"magento/magento-coding-standard": "5"
2121
},
2222
"autoload": {
2323
"psr-4": {
@@ -48,5 +48,13 @@
4848
"ext-soap": "7.1",
4949
"ext-zip": "7.1"
5050
}
51+
},
52+
"scripts": {
53+
"post-install-cmd": [
54+
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility/PHPCompatibility)"
55+
],
56+
"post-update-cmd": [
57+
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility/PHPCompatibility)"
58+
]
5159
}
5260
}

grumphp.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
parameters:
1+
grumphp:
22
tasks:
33
phpcs:
4-
standard: "ruleset.xml"
5-
warning_severity: 0
4+
standard: [PSR2]
65
ignore_patterns:
76
- "Test/Unit"
87
triggered_by: [php]

0 commit comments

Comments
 (0)