Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade project to Symfony 6.4, with Symfony Flex #201

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ GITHUB_SECRET=
GITLAB_SECRET=
GITEA_SECRET=
DEVOPS_SECRET=

###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###
6 changes: 6 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2]
php: [8.2, 8.3]

name: PHP ${{ matrix.php }}

Expand Down
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,27 @@ nb-configuration.xml
*.tmproj
*.tmproject
tmtags

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

###> phpunit/phpunit ###
/phpunit.xml
.phpunit.result.cache
###< phpunit/phpunit ###

###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
2 changes: 1 addition & 1 deletion app/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Application extends BaseApplication
/**
* {@inheritdoc}
*/
public function doRun(InputInterface $input, OutputInterface $output)
public function doRun(InputInterface $input, OutputInterface $output): int
{
$this->io = new ConsoleIO($input, $output, $this->getHelperSet());

Expand Down
42 changes: 10 additions & 32 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
#!/usr/bin/env php
<?php

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

if (false === 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_dir(dirname(__DIR__).'/vendor')) {
throw new LogicException('Dependencies are missing. Try running "composer install".');
}

set_time_limit(0);

require dirname(__DIR__) . '/config/bootstrap.php';

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
unset($env);
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

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

(new Dotenv())->usePutenv()->loadEnv(__DIR__ . '/../.env');
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

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

if (class_exists(Debug::class)) {
Debug::enable();
}
}
return function (array $context) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);

$kernel = new Kernel($_SERVER['APP_ENV'] ?? 'dev', (bool) !empty($_SERVER['APP_DEBUG']));
$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
63 changes: 40 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"minimum-stability": "stable",
"require": {
"php": "^8.1,<8.3",
"php": ">=8.2",
"ext-json": "*",
"ext-xml": "*",
"composer/composer": "^2.4",
Expand All @@ -34,23 +34,29 @@
"ninsuo/symfony-collection": "^2.1",
"ramunasd/symfony-container-mocks": "^0.6.0",
"swop/github-webhook": "^3.1",
"symfony/asset": "^5.4",
"symfony/form": "^5.4",
"symfony/framework-bundle": "^5.4",
"symfony/lock": "^5.4",
"symfony/property-info": "^5.0",
"symfony/psr-http-message-bridge": "^2.0",
"symfony/security-bundle": "^5.4",
"symfony/serializer": "^5.4",
"symfony/twig-bundle": "^5.4",
"symfony/validator": "^5.4",
"symfony/yaml": "^5.4",
"symfony/asset": "6.4.*",
"symfony/form": "6.4.*",
"symfony/framework-bundle": "6.4.*",
"symfony/lock": "6.4.*",
"symfony/property-info": "6.4.*",
"symfony/psr-http-message-bridge": "6.4.*",
"symfony/security-bundle": "6.4.*",
"symfony/serializer": "6.4.*",
"symfony/twig-bundle": "6.4.*",
"symfony/validator": "6.4.*",
"symfony/yaml": "6.4.*",
"laminas/laminas-diactoros": "^2.3",
"symfony/monolog-bundle": "^3.8",
"symfony/dependency-injection": "^5.4",
"symfony/event-dispatcher": "^5.4",
"symfony/proxy-manager-bridge": "^6.0",
"symfony/dotenv": "^6.4"
"symfony/dependency-injection": "6.4.*",
"symfony/event-dispatcher": "6.4.*",
"symfony/proxy-manager-bridge": "6.4.*",
"symfony/dotenv": "6.4.*",
"symfony/flex": "^2.4",
"symfony/console": "^7.1.5",
"symfony/runtime": "6.4.*",
"phpdocumentor/reflection-docblock": "^5.6",
"phpstan/phpdoc-parser": "^2.0",
"symfony/property-access": "6.4.*"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
Expand All @@ -60,15 +66,16 @@
"phpstan/phpstan-symfony": "^1.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^10.5",
"symfony/browser-kit": "^5.4"
"symfony/browser-kit": "6.4.*",
"symfony/stopwatch": "6.4.*",
"symfony/web-profiler-bundle": "6.4.*",
"symfony/css-selector": "6.4.*"
},
"autoload": {
"psr-4": { "Playbloom\\Satisfy\\": "src/Playbloom/Satisfy" },
"files": ["src/Kernel.php"]
"psr-4": { "Playbloom\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Tests\\": "tests" },
"files": ["src/TestKernel.php"]
"psr-4": { "Playbloom\\Tests\\": "tests" }
},
"scripts": {
"post-install-cmd": [
Expand All @@ -84,9 +91,17 @@
],
"phpunit": "phpunit",
"phpstan": "phpstan analyse",
"php-cs-fixer": "php-cs-fixer fix --diff --show-progress=dots"
"php-cs-fixer": "php-cs-fixer fix --diff --show-progress=dots",
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
}
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.4.*"
},
"branch-alias": {
"dev-master": "1.0.x-dev"
},
Expand All @@ -97,7 +112,9 @@
"config": {
"bin-dir": "bin",
"allow-plugins": {
"composer/satis": true
"composer/satis": true,
"symfony/flex": true,
"symfony/runtime": true
}
}
}
Loading
Loading