Skip to content

Commit 714dc02

Browse files
update to symfony 5 and php 8.x (#3)
* update phpunit to ^9 match symfony 4.4 website-skeleton * remove doctrine AnnotationRegistry * update signatures of setUp and tearDown * add php 8.0 and 8.1 to test matrix * remove php 7.2 and 7.3, bump minimum phpunit to 8.5 * set minimum version that supports 8.1 * update github to ubuntu-20.04 * update to symfony ^5.0 * enable annotations Co-authored-by: Jeffrey Wong <jwong@dayspringpartners.com>
1 parent f2f652b commit 714dc02

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ on:
66
jobs:
77
test:
88

9-
runs-on: ubuntu-18.04
9+
runs-on: ubuntu-22.04
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
php: [ '7.2', '7.3', '7.4' ]
13+
php: [ '7.4', '8.0', '8.1' ]
1414
composer: [ '', '--prefer-lowest' ]
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818

1919
- name: Use PHP
2020
uses: shivammathur/setup-php@v2
2121
with:
2222
php-version: ${{ matrix.php }}
2323
extensions: sqlite3, zip
2424
coverage: xdebug
25-
tools: composer:v1
25+
tools: composer:v2
2626

2727
- name: Get Composer Cache Directory
2828
id: composer-cache
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: cache dependencies
3434
id: cache-dependencies
35-
uses: actions/cache@v1
35+
uses: actions/cache@v3
3636
with:
3737
path: ${{ steps.composer-cache.outputs.dir }}
3838
key: ${{ runner.os }}-${{ matrix.php }}-${{ matrix.composer }}-composer-${{ hashFiles('**/composer.lock') }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Tests/Resources/cache
66
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
77

88
# User-specific stuff:
9+
.idea
910
.idea/workspace.xml
1011
.idea/tasks.xml
1112
.idea/dictionaries

Framework/Test/ServiceTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ protected function callMethod($obj, $name, array $args)
146146
/**
147147
* Shuts the kernel down if it was used in the test.
148148
*/
149-
protected function setUp()
149+
protected function setUp(): void
150150
{
151151
static::$kernel = static::createKernel();
152152
static::$kernel->boot();
153153
}
154154
/**
155155
* Shuts the kernel down if it was used in the test.
156156
*/
157-
protected function tearDown()
157+
protected function tearDown(): void
158158
{
159159
if (null !== static::$kernel) {
160160
static::$kernel->shutdown();

Tests/Resources/config/config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ imports:
44
framework:
55
test: ~
66
secret: xxxxxxxxxx
7-
router: { resource: "%kernel.root_dir%/config/routing.yml" }
7+
router: { resource: "%kernel.project_dir%/config/routing.yml" }
88
form: ~
99
csrf_protection: ~
10+
annotations: { enabled: true }
1011
validation: { enable_annotations: true }
1112
#serializer: { enable_annotations: true }
12-
templating: { engines: ['twig', 'php'] }
13+
# templating: { engines: ['twig', 'php'] }
1314
session:
1415
storage_id: session.storage.mock_file
1516
profiler:

Tests/autoload.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php
22

3-
use Doctrine\Common\Annotations\AnnotationRegistry;
43
use Composer\Autoload\ClassLoader;
54

65
/**
76
* @var ClassLoader $loader
87
*/
98
$loader = require __DIR__.'/../vendor/autoload.php';
109

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

composer.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=7.0",
24-
"symfony/framework-bundle": "^3.4|^4.0",
25-
"symfony/symfony": "^3.4|^4.0",
26-
"phpunit/phpunit": "^6.0"
27-
23+
"php": ">=7.4",
24+
"symfony/framework-bundle": "^4.4.12|^5.0",
25+
"symfony/symfony": "^4.4.12|^5.0",
26+
"phpunit/phpunit": "^8.5.23|^9.0"
27+
},
28+
"require-dev": {
29+
"doctrine/annotations": "^1.13.0"
2830
},
2931
"autoload": {
3032
"psr-4": {

0 commit comments

Comments
 (0)