Skip to content

Commit f3b7819

Browse files
Provide support for Symfony ^6.0 (#11)
* up to php 8.1 * add support for symfony 6 * update qodana action * Update qodana to 2023.3 * update bref * change supported php versions to match bref * fix typo in composer.json * switch to ramsey/composer-install; add php8.4 * exclude 8.4 and lowest
1 parent 5fcd8d1 commit f3b7819

File tree

7 files changed

+29
-32
lines changed

7 files changed

+29
-32
lines changed

.github/workflows/qodana.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
working-directory: ./
5353

5454
- name: 'Qodana Scan'
55-
uses: JetBrains/qodana-action@v2023.2
55+
uses: JetBrains/qodana-action@v2024.1
5656
with:
5757
args: --baseline,qodana.sarif.json
5858
env:

.github/workflows/symfony.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
php:
14-
- '7.4'
14+
# - '7.4'
1515
- '8.0'
1616
- '8.1'
1717
- '8.2'
18-
composer:
19-
- ''
20-
- '--prefer-lowest'
21-
18+
- '8.3'
19+
- '8.4'
20+
deps:
21+
- 'highest'
22+
- 'lowest'
23+
exclude:
24+
- php: '8.4'
25+
deps: 'lowest'
26+
2227
steps:
23-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2429

2530
- name: Use PHP
2631
uses: shivammathur/setup-php@v2
@@ -38,7 +43,7 @@ jobs:
3843

3944
- name: cache dependencies
4045
id: cache-dependencies
41-
uses: actions/cache@v3
46+
uses: actions/cache@v4
4247
with:
4348
path: ${{ steps.composer-cache.outputs.dir }}
4449
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -50,11 +55,10 @@ jobs:
5055
working-directory: ./
5156

5257
- name: Install dependencies
53-
env:
54-
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
55-
COMPOSER_FLAGS: ${{ matrix.composer }}
56-
run: composer update ${COMPOSER_FLAGS} --prefer-source
57-
working-directory: ./
58+
uses: ramsey/composer-install@v3
59+
with:
60+
dependency-versions: '${{ matrix.deps }}'
61+
working-directory: ./
5862

5963
- name: Run Tests
6064
run: composer run-script ci-test

Bootstrap/service.php

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

2525
$env = getenv('SYMFONY_ENV') ?: 'dev';
2626
$debug = getenv('SYMFONY_DEBUG') !== '0' && $env !== 'prod';
27-
$handlerService = getenv('_HANDLER') ?: 'Dayspring\LambdaBundle\Service\EchoLambdaHandlerService';
27+
$handlerService = getenv('_HANDLER') ?: \Dayspring\LambdaBundle\Service\EchoLambdaHandlerService::class;
2828

2929
$lambdaMemorySize = getenv('AWS_LAMBDA_FUNCTION_MEMORY_SIZE');
3030
if ($lambdaMemorySize) {
@@ -60,11 +60,7 @@
6060
$service->init();
6161
} catch (Exception $e) {
6262
// error getting service
63-
$lambdaRuntime->failInitialization(sprintf(
64-
"Error initializing function - %s: %s",
65-
get_class($e),
66-
$e->getMessage()
67-
));
63+
$lambdaRuntime->failInitialization($e);
6864
}
6965

7066
while (true) {

Tests/autoload.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,4 @@
88
*/
99
$loader = require __DIR__.'/../vendor/autoload.php';
1010

11-
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
12-
1311
return $loader;

composer.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@
2121
}
2222
],
2323
"require": {
24-
"php": ">=7.4",
24+
"php": ">=8.0",
2525
"ext-json": "*",
26-
"symfony/dotenv": "^4.4|^5.0",
27-
"symfony/framework-bundle": "^4.4|^5.0",
28-
"symfony/yaml": "^4.4|^5.0",
29-
"sensio/framework-extra-bundle": "^5.0.1",
30-
"bref/bref": "^1.7"
26+
"symfony/dotenv": "^4.4|^5.0|^6.0",
27+
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
28+
"symfony/yaml": "^4.4|^5.0|^6.0",
29+
"bref/bref": "^2.1.17"
3130
},
3231
"require-dev": {
33-
"phpunit/phpunit": "^8.5.14"
32+
"phpunit/phpunit": "^8.5.14",
33+
"rector/rector": "^1.0",
34+
"symfony/console": "^4.4|^5.0|^6.0"
3435
},
3536
"autoload": {
3637
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
convertWarningsToExceptions="true"
88
processIsolation="false"
99
stopOnFailure="false"
10-
syntaxCheck="false"
1110
bootstrap="Tests/autoload.php">
1211

1312
<php>
@@ -22,8 +21,7 @@
2221
</testsuites>
2322

2423
<logging>
25-
<log type="junit" target="build/logs/junit.xml"
26-
logIncompleteSkipped="false"/>
24+
<log type="junit" target="build/logs/junit.xml"/>
2725
</logging>
2826

2927
<filter>

qodana.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: "1.0"
2-
linter: jetbrains/qodana-php:2023.1-eap
2+
linter: jetbrains/qodana-php:2024.1
33
profile:
44
name: qodana.recommended
55
include:

0 commit comments

Comments
 (0)