Skip to content

Commit dacec69

Browse files
committed
feat: add symfony 70 support
Signed-off-by: serhiidonii <[email protected]>
1 parent aa72bbe commit dacec69

File tree

6 files changed

+48
-13
lines changed

6 files changed

+48
-13
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ jobs:
77
fail-fast: false
88
matrix:
99
operating-system: [ubuntu-latest]
10-
php-versions: ['8.2']
11-
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
10+
php-versions: ['8.2', '8.3', '8.4']
11+
symfony: ['6.3', '6.4', '7.0', '7.1', '7.2']
12+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} with Symfony ${{ matrix.symfony }}
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v3
@@ -19,15 +20,34 @@ jobs:
1920
php-version: ${{ matrix.php-versions }}
2021
coverage: xdebug
2122
tools: composer:v2.5
22-
extensions: swoole
23+
extensions: swoole inotify
2324

2425
- name: Get Composer Cache Directory
2526
id: composer-cache
2627
shell: bash
2728
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
2829

30+
- name: Update Symfony version
31+
run: |
32+
rm -rf composer.lock vendor
33+
composer require symfony/console:${{ matrix.symfony }} \
34+
symfony/dependency-injection:${{ matrix.symfony }} \
35+
symfony/framework-bundle:${{ matrix.symfony }} \
36+
symfony/http-kernel:${{ matrix.symfony }} \
37+
symfony/runtime:${{ matrix.symfony }} \
38+
symfony/http-foundation:${{ matrix.symfony }} \
39+
--no-update --no-scripts
40+
2941
- name: Install Composer dependencies
30-
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
42+
run: composer install
43+
44+
- name: Show installed packages
45+
run: composer show
46+
47+
- name: Show php info
48+
run: |
49+
php -v
50+
php -m
3151
3252
- name: Cache dependencies
3353
uses: actions/cache@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
vendor
33
composer.lock
44
.phpunit.cache
5+
/docker-compose.override.yaml

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
],
2020
"require": {
2121
"php": ">=8.2",
22-
"symfony/console": "^6.3",
23-
"symfony/dependency-injection": "^6.3",
24-
"symfony/framework-bundle": "^6.3",
25-
"symfony/http-foundation": "^6.3",
26-
"symfony/http-kernel": "^6.3",
27-
"symfony/runtime": "^6.3"
22+
"symfony/console": "^6.3 | ^7.0",
23+
"symfony/dependency-injection": "^6.3 | ^7.0",
24+
"symfony/framework-bundle": "^6.3 | ^7.0",
25+
"symfony/http-foundation": "^6.3 | ^7.0",
26+
"symfony/http-kernel": "^6.3 | ^7.0",
27+
"symfony/runtime": "^6.3 | ^7.0"
2828
},
2929
"require-dev": {
3030
"mockery/mockery": "^1.6",
@@ -51,6 +51,6 @@
5151
},
5252
"scripts": {
5353
"tests": "phpunit",
54-
"analyze": "phpstan"
54+
"analyze": "phpstan --memory-limit=-1"
5555
}
5656
}

docker-compose.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
swoole-8.2:
3+
image: phpswoole/swoole:php8.2
4+
volumes:
5+
- ./:/app
6+
swoole-8.3:
7+
image: phpswoole/swoole:php8.3
8+
volumes:
9+
- ./:/app
10+
swoole-8.4:
11+
image: phpswoole/swoole:php8.4
12+
volumes:
13+
- ./:/app

src/Kernel/SwooleKernelTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ protected function initializeContainer(): void
2626
{
2727
parent::initializeContainer();
2828

29-
if ($this->server) {
29+
if ($this->server && null !== $this->container) {
3030
$this->container->set(
3131
'swoolefony.server',
3232
$this->server,
3333
);
3434
}
3535
}
3636

37-
public function __wakeup()
37+
public function __wakeup(): void
3838
{
3939
self::__construct(
4040
$this->environment,

src/Server/Server.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function getStatus(): Status
7070
phpPid: $this->options->shouldDaemonize() ? null : $this->pid,
7171
port: $this->server()->port,
7272
ip: $this->server()->host,
73+
// @phpstan-ignore-next-line
7374
stats: new Stats((array) $this->server()->stats())
7475
);
7576
}

0 commit comments

Comments
 (0)