Skip to content

Commit

Permalink
Stack update
Browse files Browse the repository at this point in the history
- changed minimal PHP version to `8.3`
- dropped support for Latte v2
- dropped support for symfony components v5 and v6
  • Loading branch information
tg666 committed Jan 10, 2025
1 parent c092221 commit 75d712c
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 106 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coding-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
tools: composer:v2

- name: Install dependencies
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.3
tools: composer:v2

- name: Install dependencies
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
coverage: none
extensions: tokenizer
php-version: 8.3
coverage: pcov
extensions: tokenizer, uopz
tools: composer:v2

- name: Install dependencies
run: composer update --no-progress --prefer-dist --prefer-stable --optimize-autoloader --quiet
run: composer update --no-progress --prefer-dist --prefer-stable --optimize-autoloader

- name: Generate the coverage report
run: vendor/bin/tester -p phpdbg -C -s --coverage ./coverage.xml --coverage-src ./src ./tests
run: vendor/bin/tester -C -s --coverage ./coverage.xml --coverage-src ./src ./tests

- name: Upload the coverage report
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
php-versions: ['8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
36 changes: 5 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,13 @@
FROM php:7.4.33-cli-alpine3.16 AS php74

CMD ["/bin/sh"]
WORKDIR /var/www/html

RUN apk add --no-cache --update git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

CMD tail -f /dev/null

FROM php:8.0.25-cli-alpine3.16 AS php80

CMD ["/bin/sh"]
WORKDIR /var/www/html

RUN apk add --no-cache --update git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

CMD tail -f /dev/null

FROM php:8.1.12-cli-alpine3.16 AS php81

CMD ["/bin/sh"]
WORKDIR /var/www/html

RUN apk add --no-cache --update git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

CMD tail -f /dev/null

FROM php:8.2.0RC6-cli-alpine3.16 AS php82
FROM php:8.3.12-cli-alpine3.20 AS php83

CMD ["/bin/sh"]
WORKDIR /var/www/html

RUN apk add --no-cache --update git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apk add --no-cache ${PHPIZE_DEPS} \
&& pecl install pcov \
&& pecl install uopz-7.1.1 \
&& docker-php-ext-enable pcov uopz

CMD tail -f /dev/null
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,23 @@ restart:
make start

tests.all:
PHP=74 make tests.run
PHP=80 make tests.run
PHP=81 make tests.run
PHP=82 make tests.run
PHP=83 make tests.run

cs.fix:
PHP=81 make composer.update
docker exec 68publishers.webpack-encore-bundle.81 vendor/bin/php-cs-fixer fix -v
PHP=83 make composer.update
docker exec 68publishers.webpack-encore-bundle.83 vendor/bin/php-cs-fixer fix -v

cs.check:
PHP=81 make composer.update
docker exec 68publishers.webpack-encore-bundle.81 vendor/bin/php-cs-fixer fix -v --dry-run
PHP=83 make composer.update
docker exec 68publishers.webpack-encore-bundle.83 vendor/bin/php-cs-fixer fix -v --dry-run

stan:
PHP=81 make composer.update
docker exec 68publishers.webpack-encore-bundle.81 vendor/bin/phpstan analyse --level 6 src
PHP=83 make composer.update
docker exec 68publishers.webpack-encore-bundle.83 vendor/bin/phpstan analyse --level 6 src

coverage:
PHP=81 make composer.update
docker exec 68publishers.webpack-encore-bundle.81 vendor/bin/tester -p phpdbg -C -s --coverage ./coverage.xml --coverage-src ./src ./tests
PHP=83 make composer.update
docker exec 68publishers.webpack-encore-bundle.83 vendor/bin/tester -p phpdbg -C -s --coverage ./coverage.xml --coverage-src ./src ./tests

composer.update:
ifndef PHP
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.3",
"ext-json": "*",
"latte/latte": "^2.5 || ^3.0",
"nette/di": "^3.0.10",
"nette/utils": "^3.2.5 || ^4.0",
"symfony/asset": "^5.4 || ^6.0 || ^7.0",
"symfony/cache": "^5.4 || ^6.0 || ^7.0"
"latte/latte": "^3.0",
"nette/di": "^3.2",
"nette/utils": "^4.0",
"symfony/asset": "^7.0",
"symfony/cache": "^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.13",
Expand All @@ -28,8 +28,8 @@
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-nette": "^1.1",
"roave/security-advisories": "dev-latest",
"symfony/console": "^5.4",
"symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0"
"symfony/console": "^7.0",
"symfony/event-dispatcher": "^7.0"
},
"conflict": {
"nette/schema": "<1.2.0"
Expand Down
35 changes: 3 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,9 @@
version: "3.7"

services:
php74:
php83:
build:
context: .
dockerfile: Dockerfile
target: php74
container_name: 68publishers.webpack-encore-bundle.74
volumes:
- .:/var/www/html:cached

php80:
build:
context: .
dockerfile: Dockerfile
target: php80
container_name: 68publishers.webpack-encore-bundle.80
volumes:
- .:/var/www/html:cached

php81:
build:
context: .
dockerfile: Dockerfile
target: php81
container_name: 68publishers.webpack-encore-bundle.81
volumes:
- .:/var/www/html:cached

php82:
build:
context: .
dockerfile: Dockerfile
target: php82
container_name: 68publishers.webpack-encore-bundle.82
target: php83
container_name: 68publishers.webpack-encore-bundle.83
volumes:
- .:/var/www/html:cached
12 changes: 5 additions & 7 deletions src/Bridge/Symfony/Console/Command/WarmupCacheCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Symfony\Component\Cache\Adapter\NullAdapter;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Cache\Adapter\PhpArrayAdapter;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -19,10 +20,12 @@
use function file_exists;
use function unserialize;

#[AsCommand(
name: 'encore:warmup-cache',
description: 'Dumps entrypoints data into PHP file for faster loading in production environment.',
)]
final class WarmupCacheCommand extends Command
{
protected static $defaultName = 'encore:warmup-cache';

/** @var array<string, string> */
private array $cacheKeys;

Expand All @@ -39,11 +42,6 @@ public function __construct(array $cacheKeys, string $cacheFile)
$this->cacheFile = $cacheFile;
}

protected function configure(): void
{
$this->setDescription('Dumps entrypoints data into PHP file for faster loading in production environment.');
}

/**
* @throws Throwable|\Psr\Cache\InvalidArgumentException
*/
Expand Down
8 changes: 8 additions & 0 deletions tests/Bridge/Nette/Application/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

final class HttpResponse implements IResponse
{
public string $cookieDomain = '';

public string $cookiePath = '/';

public bool $cookieSecure = FALSE;

public bool $warnOnBuffer = TRUE;

private int $code = self::S200_OK;

private array $headers = [];
Expand Down
8 changes: 0 additions & 8 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,4 @@
Environment::bypassFinals();
date_default_timezone_set('Europe/Prague');

if (PHP_VERSION_ID < 80000) {
error_reporting(~E_USER_DEPRECATED);
}

if (PHP_VERSION_ID >= 80200) {
error_reporting(~E_DEPRECATED);
}

return $loader;

0 comments on commit 75d712c

Please sign in to comment.