Skip to content

Commit d536da4

Browse files
authored
NEL-58: Upgrade to PHP 8.1 and Symfony 6 (#60)
2 parents 9933764 + b4ecf16 commit d536da4

44 files changed

Lines changed: 3430 additions & 1968 deletions

Some content is hidden

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

.github/workflows/tests.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,26 @@ jobs:
2727
run: docker-compose run --rm php composer install
2828

2929
- name: Run tests
30-
run: make tests
30+
run: make all-tests
31+
32+
php:
33+
timeout-minutes: 10
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
php-version: ['8.1', '8.2']
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
42+
- name: Setup PHP with PECL extension
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: ${{ matrix.php-version }}
46+
tools: composer:v2
47+
48+
- name: Install dependencies
49+
run: composer update
50+
51+
- name: Run tests
52+
run: ./vendor/bin/simple-phpunit

.php_cs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
->notName('*Spec.php')
55
->files();
66

7-
return PhpCsFixer\Config::create()
8-
->setUsingCache(false)
7+
$config = new PhpCsFixer\Config();
8+
return $config->setUsingCache(false)
99
->setRules([
1010
'@PSR2' => true,
1111
'linebreak_after_opening_tag' => true,

Dockerfile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ RUN echo 'APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;' > /etc/apt/
1414
apt-get --yes install \
1515
curl \
1616
git \
17-
php7.2-bcmath \
18-
php7.2-cli \
19-
php7.2-curl \
20-
php7.2-fpm \
21-
php7.2-intl \
22-
php7.2-mbstring \
23-
php7.2-opcache \
24-
php7.2-xdebug \
25-
php7.2-xml \
26-
php7.2-zip \
17+
php8.1-bcmath \
18+
php8.1-cli \
19+
php8.1-curl \
20+
php8.1-fpm \
21+
php8.1-intl \
22+
php8.1-mbstring \
23+
php8.1-opcache \
24+
php8.1-xdebug \
25+
php8.1-xml \
26+
php8.1-zip \
2727
ssh \
2828
unzip &&\
2929
apt-get clean && \
3030
rm -rf /var/lib/apt/lists/* && \
31-
ln -s /usr/sbin/php-fpm7.2 /usr/local/sbin/php-fpm
31+
ln -s /usr/sbin/php-fpm8.1 /usr/local/sbin/php-fpm
3232

33-
COPY docker/xdebug.ini /etc/php/7.2/mods-available/nelson.ini
33+
COPY docker/xdebug.ini /etc/php/8.1/mods-available/nelson.ini
3434
RUN phpenmod nelson
3535

36-
COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer
36+
COPY --from=composer:2.3 /usr/bin/composer /usr/local/bin/composer
3737
RUN chmod +x /usr/local/bin/composer \
3838
&& useradd -m docker \
3939
&& mkdir -p /home/docker/.composer/cache \

app/console

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env php
22
<?php
33

4+
use Akeneo\Application;
5+
46
require_once('vendor/autoload.php');
5-
require_once('Application.php');
67

78
set_time_limit(0);
89
ini_set('error_reporting', E_ALL);

composer.json

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,38 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=7.1",
22+
"php": "^8.1",
2323
"ext-simplexml": "*",
2424
"ext-zip": "*",
25-
"symfony/console": "2.7.3",
26-
"symfony/yaml": "2.7.3",
27-
"symfony/finder": "2.7.3",
28-
"symfony/config": "^2.7",
29-
"monolog/monolog": "~1.0",
30-
"akeneo/crowdin-api": "1.0.0-alpha7",
31-
"knplabs/github-api": "1.4.14",
32-
"symfony/dependency-injection": "^2.7",
33-
"symfony/translation": "^2.7"
25+
"akeneo/crowdin-api": "^2.0.0",
26+
"guzzlehttp/guzzle": "^6.5",
27+
"http-interop/http-factory-guzzle": "^1.2",
28+
"knplabs/github-api": "@stable",
29+
"monolog/monolog": "@stable",
30+
"symfony/config": "^6.2.0",
31+
"symfony/console": "^6.2.0",
32+
"symfony/dependency-injection": "^6.2.0",
33+
"symfony/finder": "^6.2.0",
34+
"symfony/translation": "^6.2.0",
35+
"symfony/yaml": "^6.2.0"
3436
},
3537
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "^2.2",
37-
"phpspec/phpspec": "2.5.*",
38-
"phpstan/phpstan": "^1.10",
39-
"phpstan/phpstan-deprecation-rules": "^1.1",
38+
"friendsofphp/php-cs-fixer": "^v3.14.0",
39+
"phpspec/phpspec": "^7.3.0",
40+
"phpstan/phpstan": "^1.10.0",
41+
"phpstan/phpstan-deprecation-rules": "^1.1.0",
4042
"symfony/phpunit-bridge": "^6.2"
4143
},
4244
"autoload": {
43-
"psr-0": {"Akeneo\\": "src/"}
45+
"psr-4": {
46+
"Akeneo\\": "src/Akeneo",
47+
"spec\\Akeneo\\": "spec/Akeneo"
48+
}
4449
},
45-
"autoload-dev": {
46-
"psr-4": {"Tests\\Akeneo\\": "tests/Akeneo/"}
50+
"config": {
51+
"sort-packages": true,
52+
"allow-plugins": {
53+
"php-http/discovery": true
54+
}
4755
}
4856
}

0 commit comments

Comments
 (0)