Skip to content

Commit ec49018

Browse files
weaverryanNyholmOskarStark
authored
Updating dependencies and php version (#212)
* Updating dependencies * upgrading to php 8.1 * Update composer.json Co-authored-by: Oskar Stark <[email protected]> * Update to Symfony 6.4 * cs * fixed tests * fix tests better * Maybe fixed tests? * Add compiler pass * Little bit better --------- Co-authored-by: Tobias Nyholm <[email protected]> Co-authored-by: Oskar Stark <[email protected]>
1 parent 832466b commit ec49018

21 files changed

+1557
-2027
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up PHP
1616
uses: shivammathur/[email protected]
1717
with:
18-
php-version: 7.4
18+
php-version: 8.1
1919
coverage: none
2020

2121
- name: Checkout code
@@ -29,9 +29,9 @@ jobs:
2929
uses: actions/cache@v2
3030
with:
3131
path: ${{ steps.composer-cache.outputs.dir }}
32-
key: composer-${{ runner.os }}-7.4-${{ hashFiles('composer.*') }}
32+
key: composer-${{ runner.os }}-8.1-${{ hashFiles('composer.*') }}
3333
restore-keys: |
34-
composer-${{ runner.os }}-7.4-
34+
composer-${{ runner.os }}-8.1-
3535
composer-${{ runner.os }}-
3636
composer-
3737

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup PHP
1616
uses: shivammathur/setup-php@v2
1717
with:
18-
php-version: 7.4
18+
php-version: 8.1
1919
coverage: none
2020
tools: phpstan:1.4.6, cs2pr
2121

@@ -36,7 +36,7 @@ jobs:
3636
- name: Setup PHP
3737
uses: shivammathur/setup-php@v2
3838
with:
39-
php-version: 7.4
39+
php-version: 8.1
4040
coverage: none
4141
tools: php-cs-fixer:3.6, cs2pr
4242

.platform.app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: carson-bot
22

3-
type: php:7.4
3+
type: php:8.1
44

55
runtime:
66
extensions:

bin/console

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,15 @@
33

44
use App\Kernel;
55
use Symfony\Bundle\FrameworkBundle\Console\Application;
6-
use Symfony\Component\Console\Input\ArgvInput;
7-
use Symfony\Component\Dotenv\Dotenv;
8-
use Symfony\Component\ErrorHandler\Debug;
96

10-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
11-
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL;
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
129
}
1310

14-
set_time_limit(0);
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
1512

16-
require dirname(__DIR__).'/vendor/autoload.php';
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
1715

18-
if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
19-
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
20-
}
21-
22-
$input = new ArgvInput();
23-
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
24-
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
25-
}
26-
27-
if ($input->hasParameterOption('--no-debug', true)) {
28-
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
29-
}
30-
31-
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
32-
33-
if ($_SERVER['APP_DEBUG']) {
34-
umask(0000);
35-
36-
if (class_exists(Debug::class)) {
37-
Debug::enable();
38-
}
39-
}
40-
41-
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
42-
$application = new Application($kernel);
43-
$application->run($input);
16+
return new Application($kernel);
17+
};

composer.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,58 @@
44
"type": "project",
55
"license": "MIT",
66
"require": {
7-
"php": ">=7.4",
7+
"php": ">=8.1",
88
"ext-json": "*",
99
"composer/package-versions-deprecated": "^1.11",
10+
"doctrine/common": "^3.0",
11+
"doctrine/dbal": "^2.13",
1012
"doctrine/doctrine-bundle": "^2.4",
1113
"doctrine/doctrine-migrations-bundle": "^3.0",
12-
"doctrine/dbal": "^2.13",
13-
"doctrine/common": "^3.0",
1414
"doctrine/orm": "^2.7",
1515
"incenteev/composer-parameter-handler": "~2.0",
1616
"knplabs/github-api": "^3.3",
1717
"nyholm/psr7": "^1.3",
18-
"sensio/framework-extra-bundle": "^5.2",
19-
"symfony/console": "^5.2",
20-
"symfony/dotenv": "^5.2",
18+
"symfony/console": "^6.4",
19+
"symfony/dotenv": "^6.4",
2120
"symfony/flex": "^1.18.6",
22-
"symfony/framework-bundle": "^5.4",
23-
"symfony/http-client": "^5.2",
24-
"symfony/lock": "^5.2",
21+
"symfony/framework-bundle": "^6.4",
22+
"symfony/http-client": "^6.4",
23+
"symfony/lock": "^6.4",
2524
"symfony/monolog-bundle": "~3.5",
26-
"symfony/security-core": "^5.2",
27-
"symfony/twig-bundle": "^5.1",
28-
"symfony/yaml": "^5.2",
25+
"symfony/runtime": "^6.4",
26+
"symfony/security-core": "^6.4",
27+
"symfony/translation-contracts": "*",
28+
"symfony/twig-bundle": "^6.4",
29+
"symfony/yaml": "^6.4",
2930
"twig/extra-bundle": "^3.3",
3031
"twig/twig": "^3.3.8"
3132
},
3233
"conflict": {
3334
"symfony/symfony": "*"
3435
},
3536
"require-dev": {
36-
"happyr/service-mocking": "^0.1.3",
37-
"symfony/browser-kit": "^5.2",
37+
"happyr/service-mocking": "^0.3",
38+
"symfony/browser-kit": "^6.4",
3839
"phpunit/phpunit": "^9.5",
39-
"symfony/web-profiler-bundle": "^5.2"
40+
"symfony/web-profiler-bundle": "^6.4"
4041
},
4142
"config": {
4243
"platform": {
43-
"php": "7.4"
44+
"php": "8.1"
4445
},
4546
"preferred-install": {
4647
"*": "dist"
4748
},
4849
"sort-packages": true,
4950
"allow-plugins": {
50-
"symfony/flex": true
51+
"symfony/flex": true,
52+
"php-http/discovery": true,
53+
"symfony/runtime": true
5154
}
5255
},
5356
"extra": {
5457
"symfony": {
55-
"allow-contrib": true,
56-
"require": "^5.1"
58+
"allow-contrib": true
5759
}
5860
},
5961
"autoload": {

0 commit comments

Comments
 (0)