Skip to content

Commit

Permalink
⬆️ Upgrade to Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
p-bizouard committed Feb 18, 2023
1 parent 203fda7 commit 2b1c456
Show file tree
Hide file tree
Showing 70 changed files with 4,112 additions and 4,144 deletions.
19 changes: 1 addition & 18 deletions .env
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
# In all environments, the following files are loaded if they exist,

# the latter taking precedence over the former:

#

# \* .env contains default values for the environment variables needed by the app

# \* .env.local uncommitted file with local overrides

# \* .env.\$APP_ENV committed environment-specific defaults

# \* .env.\$APP_ENV.local uncommitted environment-specific overrides

#

# Real environment variables win over .env files.

#

# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.

# https://symfony.com/doc/current/configuration/secrets.html
#

# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).

# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration

###> symfony/framework-bundle ###
Expand All @@ -38,15 +26,10 @@ MAILER_DSN=smtp://mailhog:1025
###> doctrine/doctrine-bundle ###

# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url

# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml

#

# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"

# DATABASE_URL="mysql://db_user:[email protected]:3306/db_name?serverVersion=5.7"

DATABASE_URL="postgresql://db:db@postgres:5432/db?serverVersion=13&charset=utf8"
###< doctrine/doctrine-bundle ###

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
###< symfony/framework-bundle ###

###> symfony/phpunit-bridge ###
.phpunit
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###
Expand Down
3 changes: 0 additions & 3 deletions assets/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@

// any CSS you import will output into a single css file (app.css in this case)
import "./styles/app.css";

// start the Stimulus application
import "./bootstrap";
11 changes: 0 additions & 11 deletions assets/bootstrap.js

This file was deleted.

4 changes: 0 additions & 4 deletions assets/controllers.json

This file was deleted.

16 changes: 0 additions & 16 deletions assets/controllers/hello_controller.js

This file was deleted.

40 changes: 7 additions & 33 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,15 @@

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;

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

set_time_limit(0);
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

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

if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {
throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
20 changes: 13 additions & 7 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/usr/bin/env php
<?php

if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
125 changes: 63 additions & 62 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,72 +6,72 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"php": "^8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.4",
"doctrine/annotations": "^1.13",
"doctrine/doctrine-bundle": "^2.5",
"doctrine/annotations": "^2",
"doctrine/doctrine-bundle": "^2.8",
"doctrine/doctrine-migrations-bundle": "^3.2",
"doctrine/orm": "^2.10",
"easycorp/easyadmin-bundle": "^3.2",
"ecphp/cas-bundle": "*",
"gedmo/doctrine-extensions": "^3.0",
"nesbot/carbon": "^2.48",
"doctrine/orm": "^2.14",
"easycorp/easyadmin-bundle": "^4.5",
"ecphp/cas-bundle": "^2.5",
"gedmo/doctrine-extensions": "^3",
"nesbot/carbon": "^2.66",
"phpdocumentor/reflection-docblock": "^5.3",
"predis/predis": "^1.1",
"sensio/framework-extra-bundle": "^5.1",
"stof/doctrine-extensions-bundle": "^1.6",
"symfony/asset": "*",
"symfony/cache": "*",
"symfony/console": "*",
"symfony/dotenv": "*",
"symfony/expression-language": "*",
"symfony/filesystem": "*",
"symfony/flex": "^1.3.1",
"symfony/form": "*",
"symfony/framework-bundle": "*",
"symfony/http-client": "*",
"symfony/intl": "*",
"symfony/lock": "*",
"symfony/mailer": "*",
"symfony/maker-bundle": "^1.30",
"symfony/mime": "*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "*",
"symfony/process": "*",
"symfony/property-access": "*",
"symfony/property-info": "*",
"symfony/proxy-manager-bridge": "*",
"symfony/security-bundle": "*",
"symfony/serializer": "*",
"symfony/string": "*",
"symfony/translation": "*",
"symfony/twig-bundle": "*",
"symfony/validator": "*",
"symfony/web-link": "*",
"symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "*",
"symfony/yaml": "*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
"predis/predis": "^2.1",
"stof/doctrine-extensions-bundle": "^1.7",
"symfony/asset": "6.2.*",
"symfony/cache": "6.2.*",
"symfony/console": "6.2.*",
"symfony/dotenv": "6.2.*",
"symfony/expression-language": "6.2.*",
"symfony/filesystem": "6.2.*",
"symfony/flex": "^2.2",
"symfony/form": "6.2.*",
"symfony/framework-bundle": "6.2.*",
"symfony/http-client": "6.2.*",
"symfony/intl": "6.2.*",
"symfony/lock": "6.2.*",
"symfony/mailer": "6.2.*",
"symfony/maker-bundle": "^1.48",
"symfony/mime": "6.2.*",
"symfony/monolog-bundle": "^3.8",
"symfony/notifier": "6.2.*",
"symfony/process": "6.2.*",
"symfony/property-access": "6.2.*",
"symfony/property-info": "6.2.*",
"symfony/proxy-manager-bridge": "6.2.*",
"symfony/runtime": "6.2.*",
"symfony/security-bundle": "6.2.*",
"symfony/serializer": "6.2.*",
"symfony/string": "6.2.*",
"symfony/translation": "6.2.*",
"symfony/twig-bundle": "6.2.*",
"symfony/validator": "6.2.*",
"symfony/web-link": "6.2.*",
"symfony/webpack-encore-bundle": "^1.16",
"symfony/workflow": "6.2.*",
"symfony/yaml": "6.2.*",
"twig/extra-bundle": "^3.5",
"twig/twig": "^3.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.8",
"hautelook/alice-bundle": "^2.9",
"phpstan/extension-installer": "^1.1",
"phpstan/phpdoc-parser": "^1.6",
"phpstan/phpstan": "^1.5",
"phpstan/phpstan-doctrine": "^1.2",
"phpstan/phpstan-phpunit": "^1.1",
"phpstan/phpstan-symfony": "^1.1",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "*",
"symfony/css-selector": "*",
"symfony/debug-bundle": "*",
"symfony/phpunit-bridge": "^6.0",
"symfony/stopwatch": "*",
"symfony/web-profiler-bundle": "*"
"friendsofphp/php-cs-fixer": "^3.14",
"hautelook/alice-bundle": "^2.11",
"phpstan/extension-installer": "^1.2",
"phpstan/phpdoc-parser": "^1.16",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-doctrine": "^1.3",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-symfony": "^1.2",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15.17",
"symfony/browser-kit": "6.2.*",
"symfony/css-selector": "6.2.*",
"symfony/debug-bundle": "6.2.*",
"symfony/phpunit-bridge": "^6.2",
"symfony/stopwatch": "6.2.*",
"symfony/web-profiler-bundle": "6.2.*"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -81,7 +81,8 @@
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"symfony/runtime": true
}
},
"autoload": {
Expand Down Expand Up @@ -115,7 +116,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "5.4.*"
"require": "6.2.*"
}
}
}
Loading

0 comments on commit 2b1c456

Please sign in to comment.