Skip to content

Commit e42beea

Browse files
Require PHP v8.1 (#36)
1 parent 6a53ee8 commit e42beea

File tree

12 files changed

+58
-166
lines changed

12 files changed

+58
-166
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
test:
44
# With APCu enabled
5-
@docker-compose exec -T -w /var/www/bundle --user=www-data apache php -d apc.enable_cli=1 vendor/bin/phpunit
5+
@docker compose exec -T -w /var/www/bundle --user=www-data apache php -d apc.enable_cli=1 vendor/bin/phpunit
66
# With APCu disabled
7-
@docker-compose exec -T -w /var/www/bundle --user=www-data apache php -d apc.enable_cli=0 vendor/bin/phpunit
7+
@docker compose exec -T -w /var/www/bundle --user=www-data apache php -d apc.enable_cli=0 vendor/bin/phpunit

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
"preferred-install": "dist"
2424
},
2525
"require": {
26-
"php": ">=8.0",
26+
"php": ">=8.1",
2727
"symfony/config": "^5.4 || ^6.4 || ^7.0",
2828
"symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0",
2929
"symfony/http-kernel": "^5.4 || ^6.4 || ^7.0"
3030
},
3131
"require-dev": {
32-
"phpunit/phpunit": "^9.4"
32+
"phpunit/phpunit": "^10.5"
3333
},
3434
"autoload": {
3535
"psr-4": {

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.6'
2-
31
services:
42
apache:
53
build:

docker/apache/Dockerfile

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
1-
FROM php:8.0.27-apache
1+
FROM php:8.1.29-apache
22

33
ENV APACHE_DOCUMENT_ROOT /var/www/html/public
44

5-
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
6-
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
7-
8-
RUN apt-get update && \
9-
apt-get -y install unzip && \
10-
apt-get -y autoremove && \
11-
apt-get -y autoclean && \
12-
apt-get -y clean
13-
14-
RUN a2enmod rewrite
15-
RUN pecl install apcu-5.1.17 && \
5+
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
6+
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
7+
apt update && \
8+
apt -y install unzip && \
9+
apt -y autoremove && \
10+
apt -y autoclean && \
11+
apt -y clean && \
12+
a2enmod rewrite && \
13+
pecl install apcu-5.1.23 && \
1614
docker-php-ext-enable \
1715
opcache \
1816
apcu
1917

20-
COPY --from=composer:2.5.1 /usr/bin/composer /usr/bin/composer
18+
COPY --from=composer:2.7.7 /usr/bin/composer /usr/bin/composer
2119

22-
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
2320
ENV COMPOSER_HOME /var/www/.composer
24-
RUN mkdir -p /var/www/.composer && \
21+
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data && \
22+
mkdir -p /var/www/.composer && \
2523
chown -R www-data /var/www/.composer

phpunit.xml.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
<?xml version="1.0"?>
12
<phpunit
23
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
4-
verbose="true"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
55
cacheResult="false"
66
colors="true"
7+
cacheDirectory=".phpunit.cache"
78
>
89
<testsuites>
910
<testsuite name="Unit test">

src/Application/Size.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ final class Size
88
{
99
private const MEGABYTE_IN_BYTES = 1024 ** 2;
1010

11-
private function __construct(private int $sizeInBytes)
11+
private function __construct(private readonly int $sizeInBytes)
1212
{
1313
}
1414

src/Application/StatsProvider/ApcuStats.php

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,12 @@
99
final class ApcuStats
1010
{
1111
public function __construct(
12-
private bool $enabled,
13-
private int $slotsSize,
14-
private int $slotsUsage,
15-
private Size $memorySize,
16-
private Size $memoryUsage,
17-
private string $memoryType,
12+
public readonly bool $enabled,
13+
public readonly int $slotsSize,
14+
public readonly int $slotsUsage,
15+
public readonly Size $memorySize,
16+
public readonly Size $memoryUsage,
17+
public readonly string $memoryType,
1818
) {
1919
}
20-
21-
public function enabled(): bool
22-
{
23-
return $this->enabled;
24-
}
25-
26-
public function slotsSize(): int
27-
{
28-
return $this->slotsSize;
29-
}
30-
31-
public function slotsUsage(): int
32-
{
33-
return $this->slotsUsage;
34-
}
35-
36-
public function memorySize(): Size
37-
{
38-
return $this->memorySize;
39-
}
40-
41-
public function memoryUsage(): Size
42-
{
43-
return $this->memoryUsage;
44-
}
45-
46-
public function memoryType(): string
47-
{
48-
return $this->memoryType;
49-
}
5020
}

src/Application/StatsProvider/JitStats.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,13 @@
88

99
final class JitStats
1010
{
11-
private Size $bufferUsage;
11+
public readonly Size $bufferUsage;
1212

1313
public function __construct(
14-
private bool $enabled,
15-
private Size $bufferSize,
14+
public readonly bool $enabled,
15+
public readonly Size $bufferSize,
1616
Size $bufferFree,
1717
) {
1818
$this->bufferUsage = $bufferSize->subtract($bufferFree);
1919
}
20-
21-
public function enabled(): bool
22-
{
23-
return $this->enabled;
24-
}
25-
26-
public function bufferSize(): Size
27-
{
28-
return $this->bufferSize;
29-
}
30-
31-
public function bufferUsage(): Size
32-
{
33-
return $this->bufferUsage;
34-
}
3520
}

src/Application/StatsProvider/OpcacheStats.php

Lines changed: 9 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,15 @@
99
final class OpcacheStats
1010
{
1111
public function __construct(
12-
private bool $enabled,
13-
private Size $size,
14-
private Size $usage,
15-
private Size $internedStringsSize,
16-
private Size $internedStringsUsage,
17-
private int $internedStringsNumber,
18-
private int $scriptSlotsSize,
19-
private int $scriptSlotsUsage,
20-
private float $hitRatio
12+
public readonly bool $enabled,
13+
public readonly Size $size,
14+
public readonly Size $usage,
15+
public readonly Size $internedStringsSize,
16+
public readonly Size $internedStringsUsage,
17+
public readonly int $internedStringsNumber,
18+
public readonly int $scriptSlotsSize,
19+
public readonly int $scriptSlotsUsage,
20+
public readonly float $hitRatio
2121
) {
2222
}
23-
24-
public function enabled(): bool
25-
{
26-
return $this->enabled;
27-
}
28-
29-
public function size(): Size
30-
{
31-
return $this->size;
32-
}
33-
34-
public function usage(): Size
35-
{
36-
return $this->usage;
37-
}
38-
39-
public function internedStringsSize(): Size
40-
{
41-
return $this->internedStringsSize;
42-
}
43-
44-
public function internedStringsUsage(): Size
45-
{
46-
return $this->internedStringsUsage;
47-
}
48-
49-
public function internedStringsNumber(): int
50-
{
51-
return $this->internedStringsNumber;
52-
}
53-
54-
public function scriptSlotsSize(): int
55-
{
56-
return $this->scriptSlotsSize;
57-
}
58-
59-
public function scriptSlotsUsage(): int
60-
{
61-
return $this->scriptSlotsUsage;
62-
}
63-
64-
public function hitRatio(): float
65-
{
66-
return $this->hitRatio;
67-
}
6823
}

src/Application/StatsProvider/RealPathStats.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,9 @@
99
final class RealPathStats
1010
{
1111
public function __construct(
12-
private bool $enabled,
13-
private Size $size,
14-
private Size $usage,
12+
public readonly bool $enabled,
13+
public readonly Size $size,
14+
public readonly Size $usage,
1515
) {
1616
}
17-
18-
public function enabled(): bool
19-
{
20-
return $this->enabled;
21-
}
22-
23-
public function size(): Size
24-
{
25-
return $this->size;
26-
}
27-
28-
public function usage(): Size
29-
{
30-
return $this->usage;
31-
}
3217
}

0 commit comments

Comments
 (0)