Skip to content

Commit

Permalink
Feat: drop support for symfony 6.3 (#88)
Browse files Browse the repository at this point in the history
* feat: drop support for symfony 6.3
  • Loading branch information
Chris53897 authored Nov 30, 2023
1 parent 74fdada commit fa9f4a8
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 76 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
matrix:
php: ['8.2']
stability: [ prefer-stable ]
symfony-version: ['6.3.*']
symfony-version: ['6.4.*']
include:
- php: '8.2'
symfony-version: 6.3.*
symfony-version: 6.4.*
stability: prefer-lowest
- php: '8.2'
symfony-version: 7.0.*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-upcoming-symfony.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
symfony-version: ['7.0.x@dev']
symfony-version: ['7.1.x@dev']
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
Expand All @@ -21,7 +21,7 @@ jobs:
uses: shivammathur/[email protected]
with:
coverage: none
php-version: '8.2'
php-version: '8.3'
tools: composer:v2
extensions: pcov, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
ini-values: date.timezone=UTC
Expand Down
3 changes: 3 additions & 0 deletions Entity/ScheduledCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ public function getNextRunDate(bool $checkExecuteImmediately = true): ?DateTime
public function getNextRunDateForHumans(): ?string
{
try{
if(!$this->getNextRunDate())
{return null;}

return Carbon::instance($this->getNextRunDate())->diffForHumans();
}
catch (\Exception)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ See [Wiki](https://github.com/Dukecity/CommandSchedulerBundle/wiki) for Details
Please read [Upgrade-News for Version 6](UPGRADE.md)

Version 6.x (unreleased) has the goal to use modern Php and Symfony features and low maintenance.
So only Php >= 8.2 and Symfony ^6.3|^7.0 are supported at the moment.
So only Php >= 8.2 and Symfony ^6.4|^7.0 are supported at the moment.

The following table shows the compatibilities of different versions of the bundle :

| Version | Symfony | PHP |
|----------------------------------------------------------------------------|----------------|-------|
| [6.x (main)](https://github.com/Dukecity/CommandSchedulerBundle/tree/main) | ^6.3 + ^7.0 | >=8.2 |
| [6.x (main)](https://github.com/Dukecity/CommandSchedulerBundle/tree/main) | ^6.4 + ^7.0 | >=8.2 |
| [5.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/5.x) | ^5.4 + ^6.0 | >=8.0 |
| [4.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/4.x) | ^4.4.20 + ^5.3 | >=8.0 |
| [3.x](https://github.com/Dukecity/CommandSchedulerBundle/tree/3.x) | ^4.4.20 + ^5.3 | >=7.3 |
Expand Down
1 change: 0 additions & 1 deletion Tests/App/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ framework:
router: { resource: "%kernel.project_dir%/Tests/App/config/routing.yml" }
form: true
csrf_protection: false
validation: { enable_annotations: true }
http_method_override: false
session:
handler_id: null
Expand Down
49 changes: 9 additions & 40 deletions Tests/App/console
Original file line number Diff line number Diff line change
@@ -1,48 +1,17 @@
#!/usr/bin/env php
/** @noinspection PhpUnhandledExceptionInspection */<?php
<?php

// used from symfony 5.2.2
use App\Tests\App\AppKernel;
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';

// custom: changed path
require dirname(__DIR__).'/../vendor/autoload.php';
return function (array $context) {
$kernel = new AppKernel($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']) {
if (true) {
umask(0000);

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

/** @noinspection PhpFullyQualifiedNameUsageInspection */
#$kernel = new \App\Tests\App\AppKernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel = new \App\Tests\App\AppKernel();

$application = new Application($kernel);
$application->run($input);
return new Application($kernel);
};
59 changes: 30 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,51 @@
],
"require": {
"php": ">=8.2",
"symfony/console": "^6.3 || ^7.0",
"symfony/console": "^6.4 || ^7.0",
"doctrine/orm": "^2.15",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/collections": "^2.1",
"doctrine/dbal": "^3.7",
"doctrine/persistence": "^3.2",
"dragonmantank/cron-expression": "^3.3",
"lorisleiva/cron-translator": "^0.4.4",
"symfony/framework-bundle": "^6.3 || ^7.0",
"symfony/twig-bundle": "^6.3 || ^7.0",
"symfony/translation": "^6.3 || ^7.0",
"symfony/finder": "^6.3 || ^7.0",
"symfony/form": "^6.3 || ^7.0",
"symfony/asset": "^6.3 || ^7.0",
"symfony/validator": "^6.3 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/finder": "^6.4 || ^7.0",
"symfony/form": "^6.4 || ^7.0",
"symfony/asset": "^6.4 || ^7.0",
"symfony/validator": "^6.4 || ^7.0",
"nesbot/carbon": "^2.71 || ^3.0",
"symfony/lock": "^6.3 || ^7.0",
"symfony/config": "^6.3 || ^7.0",
"symfony/dependency-injection": "^6.3 || ^7.0",
"symfony/property-access": "^6.3 || ^7.0",
"symfony/http-kernel": "^6.3 || ^7.0",
"symfony/routing": "^6.3 || ^7.0",
"symfony/yaml": "^6.3 || ^7.0",
"twig/twig": "^3.7"
"symfony/lock": "^6.4 || ^7.0",
"symfony/config": "^6.4 || ^7.0",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/property-access": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/routing": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
"twig/twig": "^3.8"
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.5",
"liip/test-fixtures-bundle": "^2.6",
"liip/test-fixtures-bundle": "^2.7",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.4",
"symfony/browser-kit": "^6.3 || ^7.0",
"symfony/css-selector": "^6.3 || ^7.0",
"symfony/debug-bundle": "^6.3 || ^7.0",
"symfony/dom-crawler": "^6.3 || ^7.0",
"symfony/dotenv": "^6.3 || ^7.0",
"symfony/phpunit-bridge": "^6.3 || ^7.0",
"symfony/http-client": "^6.3 || ^7.0",
"symfony/notifier": "^6.3 || ^7.0",
"symfony/maker-bundle": "^1.51",
"symfony/var-dumper": "^6.3 || ^7.0"
"nesbot/carbon": "3.x-dev as 3.0",
"symfony/browser-kit": "^6.4 || ^7.0",
"symfony/css-selector": "^6.4 || ^7.0",
"symfony/debug-bundle": "^6.4 || ^7.0",
"symfony/dom-crawler": "^6.4 || ^7.0",
"symfony/dotenv": "^6.4 || ^7.0",
"symfony/phpunit-bridge": "^6.4 || ^7.0",
"symfony/http-client": "^6.4 || ^7.0",
"symfony/notifier": "^6.4 || ^7.0",
"symfony/maker-bundle": "^1.52",
"symfony/var-dumper": "^6.4 || ^7.0"
},
"suggest": {
"ext-pcntl": "For using the scheduler daemon",
"symfony/notifier": "Send Notifications (E-Mails) ^6.3 || ^7.0",
"symfony/notifier": "Send Notifications (E-Mails) ^6.4 || ^7.0",
"twig/cssinliner-extra": "Needed for E-Mail Notification ^3.0",
"twig/inky-extra": "Needed for E-Mail Notification ^3.0",
"ext-posix": "*"
Expand All @@ -87,7 +88,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "^6.3 || ^7.0"
"require": "^6.4 || ^7.0"
}
}
}

0 comments on commit fa9f4a8

Please sign in to comment.