Skip to content

Commit 2035217

Browse files
author
Radosław Karkut
committed
Merge branch 'GRINTEGRAT-5406-prestashop-plugin-podbicie-php-do-wersji-7-2' into 'master'
[GRINTEGRAT-5406] Podbicie PHP do wersji 7.2, PhpStan, commit hooks See merge request integrations/prestashop/getresponse-for-prestashop!57
2 parents a1110cf + 36b2ada commit 2035217

File tree

91 files changed

+1999
-1287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1999
-1287
lines changed

.gitlab-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ workflow:
1717
rules:
1818
- if: $CI_COMMIT_BRANCH != "master"
1919

20-
composer install:php71:
21-
image: php:7.1-cli
20+
composer install:php72:
21+
image: php:7.2-cli
2222
stage: install_dependencies
2323
before_script:
2424
- apt-get update
@@ -34,16 +34,16 @@ composer install:php71:
3434
expire_in: 2 hrs
3535
<<: *exclude-master
3636

37-
test:app-php71:
38-
image: php:7.1-cli
37+
test:app-php72:
38+
image: php:7.2-cli
3939
stage: test
4040
tags:
4141
- hq1-small-amd64
4242
script:
4343
- ./vendor/bin/phpunit --testsuite unit --configuration ./tests/phpunit.xml --colors=never
4444
<<: *exclude-master
4545
dependencies:
46-
- composer install:php71
46+
- composer install:php72
4747

4848
upload to s3:
4949
stage: upload_to_s3

.php-cs-fixer.dist.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
$config = new PrestaShop\CodingStandards\CsFixer\Config();
4+
5+
/** @var \Symfony\Component\Finder\Finder $finder */
6+
$finder = $config->setUsingCache(true)->getFinder();
7+
$finder->in(__DIR__)->exclude('vendor');
8+
9+
return $config;

.php_cs.dist

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

Dockerfile

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
1-
FROM php:5.6-cli as php5
2-
RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
3-
RUN pecl channel-update pecl.php.net
4-
RUN pecl install http://pecl.php.net/get/xdebug-2.5.5.tgz \
5-
&& docker-php-ext-enable xdebug
6-
WORKDIR /plugin
7-
COPY --from=docker.int.getresponse.com/docker/composer:2.2.9 /usr/bin/composer /usr/bin/composer
8-
COPY . ./
9-
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g' \
10-
-e 's|security.debian.org|archive.debian.org/|g' \
11-
-e '/stretch-updates/d' /etc/apt/sources.list
12-
RUN apt-get update \
13-
&& apt-get upgrade -y \
14-
&& apt-get install -y \
15-
unzip
16-
RUN composer update --no-interaction --prefer-dist --no-suggest --no-cache
17-
ENTRYPOINT [ "/bin/bash", "-c", "tail -f /dev/null" ]
18-
19-
FROM php:7.1-cli as php7
1+
FROM php:7.2-cli as php7
202
RUN mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
213
RUN pecl channel-update pecl.php.net
224
RUN pecl install http://pecl.php.net/get/xdebug-2.9.0.tgz \

Makefile

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@
33
help: ## Display this help
44
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_\-0-9]+:.*?##/ { printf " \033[36m%-22s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
55

6-
app-php56-dev-build: ## Create environment with php5.6
7-
docker compose up -d php56
8-
docker compose exec php56 composer update
6+
app-php72-dev-build: ## Create environment with php7.2 for unit tests
7+
docker compose up -d php72
8+
docker compose exec php72 composer update
99

10-
app-php71-dev-build: ## Create environment with php7.1 for unit tests
11-
docker compose up -d php71
12-
docker compose exec php71 composer update
13-
14-
run-tests-php56: app-php56-dev-build ## Runs unit tests with php5.6
15-
docker compose exec php56 vendor/bin/phpunit --configuration tests/phpunit.xml
16-
17-
run-tests-php71: app-php71-dev-build ## Runs unit tests with php7.1
18-
docker compose exec php71 vendor/bin/phpunit --configuration tests/phpunit.xml
10+
run-tests-php72: app-php72-dev-build ## Runs unit tests with php7.2
11+
docker compose exec php72 vendor/bin/phpunit --configuration tests/phpunit.xml
1912

2013
deploy-to-github: ## Creates new release in github from gitlab tags
2114
sh deploy.sh

captainhook.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"config": {
3+
"run-mode": "docker",
4+
"run-exec": "docker exec -w /project/prestashop/modules/grprestashop prestashop-app-17",
5+
"path": "/vendor/bin/captainhook",
6+
"git": "/.git"
7+
},
8+
"commit-msg": {
9+
"enabled": false,
10+
"actions": []
11+
},
12+
"pre-push": {
13+
"enabled": false,
14+
"actions": []
15+
},
16+
"pre-commit": {
17+
18+
"enabled": true,
19+
"actions": [
20+
{
21+
"action": "composer run-script php-cs-fix"
22+
},
23+
{
24+
"action": "composer run-script phpstan"
25+
}
26+
]
27+
},
28+
"prepare-commit-msg": {
29+
"enabled": false,
30+
"actions": []
31+
},
32+
"post-commit": {
33+
"enabled": false,
34+
"actions": []
35+
},
36+
"post-merge": {
37+
"enabled": false,
38+
"actions": []
39+
},
40+
"post-checkout": {
41+
"enabled": false,
42+
"actions": []
43+
},
44+
"post-rewrite": {
45+
"enabled": false,
46+
"actions": []
47+
},
48+
"post-change": {
49+
"enabled": false,
50+
"actions": []
51+
}
52+
}

classes/WebserviceSpecificManagementGetresponseModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function getPluginDetails()
192192

193193
return json_encode(
194194
[
195-
'plugin_version' => '1.5.0',
195+
'plugin_version' => '2.0.0',
196196
'prestashop_version' => _PS_VERSION_,
197197
'php_version' => phpversion(),
198198
'shops' => $shops,

composer.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
"type": "prestashop-module",
1717
"minimum-stability": "stable",
1818
"require": {
19-
"php": ">= 5.6",
19+
"php": ">= 7.2",
2020
"beberlei/assert": "2.*"
2121
},
2222
"require-dev": {
2323
"phpunit/phpunit": "^5.0",
24-
"prestashop/php-dev-tools": "^3.16",
25-
"phpstan/phpstan": "0.12.40"
24+
"prestashop/php-dev-tools": "^5.0",
25+
"friendsofphp/php-cs-fixer": "^3.4",
26+
"captainhook/captainhook": "^5.14",
27+
"phpstan/phpstan": "^1.12",
28+
"prestashop/autoindex": "^2.1",
29+
"prestashop/header-stamp": "^2.6"
2630
},
2731
"autoload": {
2832
"psr-4": {
@@ -39,9 +43,12 @@
3943
"scripts": {
4044
"run-fixers": [
4145
"php vendor/bin/php-cs-fixer fix",
46+
"_PS_ROOT_DIR_=../../ vendor/bin/phpstan analyse --configuration=tests/phpstan/phpstan.neon --memory-limit=256M",
4247
"vendor/bin/autoindex",
4348
"vendor/bin/header-stamp --license=assets/afl.txt --exclude=vendor"
4449
],
50+
"phpstan": "_PS_ROOT_DIR_=../../ vendor/bin/phpstan analyse --configuration=tests/phpstan/phpstan.neon --memory-limit=256M",
51+
"php-cs-fix": "php vendor/bin/php-cs-fixer fix",
4552
"tests": "vendor/bin/phpunit --configuration tests/phpunit.xml"
4653
}
47-
}
54+
}

0 commit comments

Comments
 (0)