Skip to content

Commit

Permalink
NEL-58: Upgrade to PHP 8.1 and Symfony 6 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmleroux authored Aug 26, 2023
2 parents 9933764 + b4ecf16 commit d536da4
Show file tree
Hide file tree
Showing 44 changed files with 3,430 additions and 1,968 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,26 @@ jobs:
run: docker-compose run --rm php composer install

- name: Run tests
run: make tests
run: make all-tests

php:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1', '8.2']
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Install dependencies
run: composer update

- name: Run tests
run: ./vendor/bin/simple-phpunit
4 changes: 2 additions & 2 deletions .php_cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
->notName('*Spec.php')
->files();

return PhpCsFixer\Config::create()
->setUsingCache(false)
$config = new PhpCsFixer\Config();
return $config->setUsingCache(false)
->setRules([
'@PSR2' => true,
'linebreak_after_opening_tag' => true,
Expand Down
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@ RUN echo 'APT::Install-Recommends "0" ; APT::Install-Suggests "0" ;' > /etc/apt/
apt-get --yes install \
curl \
git \
php7.2-bcmath \
php7.2-cli \
php7.2-curl \
php7.2-fpm \
php7.2-intl \
php7.2-mbstring \
php7.2-opcache \
php7.2-xdebug \
php7.2-xml \
php7.2-zip \
php8.1-bcmath \
php8.1-cli \
php8.1-curl \
php8.1-fpm \
php8.1-intl \
php8.1-mbstring \
php8.1-opcache \
php8.1-xdebug \
php8.1-xml \
php8.1-zip \
ssh \
unzip &&\
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
ln -s /usr/sbin/php-fpm7.2 /usr/local/sbin/php-fpm
ln -s /usr/sbin/php-fpm8.1 /usr/local/sbin/php-fpm

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

COPY --from=composer:1 /usr/bin/composer /usr/local/bin/composer
COPY --from=composer:2.3 /usr/bin/composer /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer \
&& useradd -m docker \
&& mkdir -p /home/docker/.composer/cache \
Expand Down
3 changes: 2 additions & 1 deletion app/console
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env php
<?php

use Akeneo\Application;

require_once('vendor/autoload.php');
require_once('Application.php');

set_time_limit(0);
ini_set('error_reporting', E_ALL);
Expand Down
42 changes: 25 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,38 @@
}
],
"require": {
"php": ">=7.1",
"php": "^8.1",
"ext-simplexml": "*",
"ext-zip": "*",
"symfony/console": "2.7.3",
"symfony/yaml": "2.7.3",
"symfony/finder": "2.7.3",
"symfony/config": "^2.7",
"monolog/monolog": "~1.0",
"akeneo/crowdin-api": "1.0.0-alpha7",
"knplabs/github-api": "1.4.14",
"symfony/dependency-injection": "^2.7",
"symfony/translation": "^2.7"
"akeneo/crowdin-api": "^2.0.0",
"guzzlehttp/guzzle": "^6.5",
"http-interop/http-factory-guzzle": "^1.2",
"knplabs/github-api": "@stable",
"monolog/monolog": "@stable",
"symfony/config": "^6.2.0",
"symfony/console": "^6.2.0",
"symfony/dependency-injection": "^6.2.0",
"symfony/finder": "^6.2.0",
"symfony/translation": "^6.2.0",
"symfony/yaml": "^6.2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.2",
"phpspec/phpspec": "2.5.*",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"friendsofphp/php-cs-fixer": "^v3.14.0",
"phpspec/phpspec": "^7.3.0",
"phpstan/phpstan": "^1.10.0",
"phpstan/phpstan-deprecation-rules": "^1.1.0",
"symfony/phpunit-bridge": "^6.2"
},
"autoload": {
"psr-0": {"Akeneo\\": "src/"}
"psr-4": {
"Akeneo\\": "src/Akeneo",
"spec\\Akeneo\\": "spec/Akeneo"
}
},
"autoload-dev": {
"psr-4": {"Tests\\Akeneo\\": "tests/Akeneo/"}
"config": {
"sort-packages": true,
"allow-plugins": {
"php-http/discovery": true
}
}
}
Loading

0 comments on commit d536da4

Please sign in to comment.