Skip to content

Commit

Permalink
[Core] Symfony 7 upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
that-guy-iain committed Feb 22, 2024
1 parent 1c47b48 commit 9791922
Show file tree
Hide file tree
Showing 55 changed files with 91 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit-bridge
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql, mongodb
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, pgsql, mongodb, http
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
58 changes: 29 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"graylog2/gelf-php": "^1.7",
"guzzlehttp/guzzle": "^7.5",
"knplabs/knp-snappy": "^1.4",
"monolog/monolog": "^2.9",
"monolog/monolog": "^3.0",
"nyholm/psr7": "^1.5",
"parthenon/transaction-cloud": "dev-main",
"phpdocumentor/reflection-docblock": "^5.3",
Expand All @@ -29,47 +29,47 @@
"ramsey/uuid-doctrine": "^1.8.1",
"sendgrid/sendgrid": "~7.11",
"stripe/stripe-php": "^7.128",
"symfony/asset": "^6.3",
"symfony/console": "^6.3",
"symfony/dotenv": "^6.3",
"symfony/event-dispatcher": "^6.3",
"symfony/expression-language": "^6.3",
"symfony/asset": "^7.0",
"symfony/console": "^7.0",
"symfony/dotenv": "^7.0",
"symfony/event-dispatcher": "^7.0",
"symfony/expression-language": "^7.0",
"symfony/flex": "^1.19",
"symfony/form": "^6.1",
"symfony/framework-bundle": "^6.1",
"symfony/intl": "6.*",
"symfony/mailer": "6.*",
"symfony/monolog-bundle": "^3.8",
"symfony/doctrine-bridge": "^6.3",
"symfony/property-access": "6.*",
"symfony/property-info": "6.*",
"symfony/security-bundle": "^6.1",
"symfony/security-core": "^6.1",
"symfony/serializer": "6.*",
"symfony/translation": "^6.1",
"symfony/twig-bundle": "^6.1",
"symfony/validator": "^6.1",
"symfony/webpack-encore-bundle": "^1.15",
"symfony/yaml": "^6.1",
"symfony/form": "^7.0",
"symfony/framework-bundle": "^7.0",
"symfony/intl": "^7.0",
"symfony/mailer": "^7.0",
"symfony/monolog-bundle": ">=v3.8.0",
"symfony/doctrine-bridge": "^7.0",
"symfony/property-access": "^7.0",
"symfony/property-info": "^7.0",
"symfony/security-bundle": "^7.0",
"symfony/security-core": "^7.0",
"symfony/serializer": "^7.0",
"symfony/translation": "^7.0",
"symfony/twig-bundle": "^7.0",
"symfony/validator": "^7.0",
"symfony/webpack-encore-bundle": "^2.1.1",
"symfony/yaml": "^7.0",
"twig/extra-bundle": "^3.4",
"twig/twig": "^3.4"
},
"require-dev": {
"behat/behat": "^3.11",
"dg/bypass-finals": "~1.3.0",
"doctrine/mongodb-odm-bundle": "^4.5",
"doctrine/mongodb-odm-bundle": "^5.0",
"friends-of-behat/mink": "^1.10",
"friends-of-behat/mink-browserkit-driver": "^1.4",
"friends-of-behat/mink-extension": "^2.7",
"friends-of-behat/symfony-extension": "^2.3",
"friendsofphp/php-cs-fixer": "3.12.0",
"friendsofphp/php-cs-fixer": "^v3.14.4",
"guzzlehttp/guzzle": "^7.5",
"knplabs/knp-snappy": "^1.4",
"league/flysystem-async-aws-s3": "^2.5",
"league/flysystem-aws-s3-v3": "^2.5",
"mailgun/mailgun-php": "^3.5",
"mpdf/mpdf": "^8.1",
"okdewit/optimizely-php-sdk": "^4.0",
"optimizely/optimizely-sdk": "^4.0.1",
"docraptor/docraptor": "^3",
"php-amqplib/php-amqplib": ">=3.2.0",
"phploc/phploc": "^7.0",
Expand All @@ -79,11 +79,11 @@
"phpunit/phpunit": "^9.5",
"qossmic/deptrac-shim": "^1.0",
"roave/security-advisories": "dev-master",
"symfony/messenger": "^6.1",
"symfony/phpunit-bridge": "^6.1",
"symfony/messenger": "^7.0",
"symfony/phpunit-bridge": "^7.0",
"toin0u/digitalocean-v2": "^4.5",
"wildbit/postmark-php": "^4.0",
"symfony/web-profiler-bundle": "^6.1.6"
"symfony/web-profiler-bundle": "^7.0"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -136,7 +136,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.*"
"require": "7.*"
}
}
}
4 changes: 2 additions & 2 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
Expand All @@ -47,7 +47,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/MultiTenant/Entity'
prefix: 'App\MultiTenant\Entity'
alias: App
2 changes: 1 addition & 1 deletion config/packages/doctrine_mongodb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doctrine_mongodb:
mappings:
App:
is_bundle: false
type: annotation
type: attribute
dir: '%kernel.project_dir%/src/Document'
prefix: 'App\Document'
alias: App
Expand Down
1 change: 0 additions & 1 deletion config/packages/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ security:
access_decision_manager:
strategy: unanimous
allow_if_all_abstain: false
enable_authenticator_manager: true
providers:
parthenon:
id: Parthenon\User\Security\UserProvider
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/AbTesting/Command/CleanUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(CleanUpSessions $cleanUpSessions)
$this->generator = $cleanUpSessions;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Clean up A/B sessions');
$this->getLogger()->info('Clean up A/B sessions');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(CacheGenerator $generator)
$this->generator = $generator;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Generating ab testing decision cache');
$this->getLogger()->info('Generating ab testing decision cache');
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/AbTesting/Command/GenerateReportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(Generator $generator)
$this->generator = $generator;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Generate A/B report');
$this->getLogger()->info('Generate A/B report');
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/AbTesting/Command/GenerateStatsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(ExperimentRepositoryInterface $experimentRepository,
$this->calculate = $calculate;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Generating stats');
$this->getLogger()->info('Generate stats');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function interact(InputInterface $input, OutputInterface $output)
}
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$entityName = $input->getArgument('entity');
$configType = $input->getArgument('config_type');
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Athena/Compiler/AthenaCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
use Parthenon\Athena\Filters\FilterManager;
use Parthenon\Athena\ViewTypeManager;
use Parthenon\Export\Normaliser\NormaliserInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Security\Core\Security;

final class AthenaCompilerPass implements CompilerPassInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Athena/Controller/AthenaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
use Parthenon\Athena\DashboardSectionManager;
use Psr\Log\LoggerInterface;
use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;

class AthenaController
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Athena/Crud/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
use Parthenon\Export\Exporter\ExporterManagerInterface;
use Parthenon\Export\ExportRequest;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Security;

class CrudController
{
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Billing/Command/DailyChargeBackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(
parent::__construct(null);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Starting daily charge back command');

Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Billing/TeamCustomerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Parthenon\Common\Exception\NoEntityFoundException;
use Parthenon\User\Entity\MemberInterface;
use Parthenon\User\Repository\TeamRepositoryInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;

class TeamCustomerProvider implements CustomerProviderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Billing/UserCustomerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Parthenon\Billing\Entity\CustomerInterface;
use Parthenon\Billing\Exception\NoCustomerException;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;

final class UserCustomerProvider implements CustomerProviderInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function generateSshKey()
file_put_contents($fileDir.'/deploy.pem', $privateKey);
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('<info>Parthenon Ansible Config generator</info>');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function getExtendedTypes(): iterable
return [FormType::class];
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$request = $this->requestStack->getCurrentRequest();
if ('json' === $request->getContentType()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('parthenon');

Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Export/Engine/BackgroundEmailEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use Parthenon\Export\ExportRequest;
use Parthenon\Export\ExportResponseInterface;
use Parthenon\Export\Response\EmailResponse;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Security\Core\Security;

final class BackgroundEmailEngine implements EngineInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Funnel/Command/ProcessUnfinishedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(ActionManager $actionManager, RepositoryManager $rep
$this->logger = $logger;
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->logger->info('Starting to process unfinnished');
$output->writeln('Starting to process unfinnished');
Expand Down
4 changes: 2 additions & 2 deletions src/Parthenon/MultiTenancy/Command/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function configure()
->addOption('dry-run', null, InputOption::VALUE_NONE, 'Execute the migration as a dry run.');
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln('Starting Parthenon Multi-Tenancy Migrations');
$this->getLogger()->info('Starting Parthenon Multi-Tenancy Migrations');
Expand Down Expand Up @@ -94,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
protected function getDependencyFactory(): DependencyFactory
{
$em = $this->managerRegistry->getManager($this->entityManagerName);
$a = new \Doctrine\Migrations\Configuration\Configuration();
$a = new Configuration();
$a->addMigrationsDirectory('DoctrineMigrations', $this->migrationsDirectory);
$a->setAllOrNothing(false);
$a->setCheckDatabasePlatform(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output)
protected function execute(InputInterface $input, OutputInterface $output): int
{
$subscribers = $this->subscriberRepository->findAllSubscriptions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use Parthenon\Payments\Exception\InvalidSubscriberException;
use Parthenon\User\Team\CurrentTeamProviderInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;

final class CurrentSubscriberProvider implements CurrentSubscriberProviderInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Parthenon/Resources/config/services/billing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
</service>

<service id="Parthenon\Billing\UserCustomerProvider" class="Parthenon\Billing\UserCustomerProvider">
<argument type="service" id="Symfony\Component\Security\Core\Security" />
<argument type="service" id="Symfony\Bundle\SecurityBundle\Security" />
</service>

<service id="Parthenon\Billing\TeamCustomerProvider" class="Parthenon\Billing\TeamCustomerProvider">
<argument type="service" id="Symfony\Component\Security\Core\Security" />
<argument type="service" id="Symfony\Bundle\SecurityBundle\Security" />
<argument type="service" id="Parthenon\User\Repository\TeamRepositoryInterface" />
</service>

Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Resources/config/services/export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<service id="parthenon.export.user_provider" alias="Symfony\Component\Security\Core\User\UserProviderInterface" />

<service id="Parthenon\Export\Engine\BackgroundEmailEngine" class="Parthenon\Export\Engine\BackgroundEmailEngine">
<argument type="service" id="Symfony\Component\Security\Core\Security" />
<argument type="service" id="Symfony\Bundle\SecurityBundle\Security" />
<argument type="service" id="Symfony\Component\Messenger\MessageBusInterface" />
<call method="setLogger">
<argument type="service" id="logger" />
Expand Down
2 changes: 1 addition & 1 deletion src/Parthenon/Resources/config/services/payments.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<service id="Parthenon\Payments\Subscriber\CurrentSubscriberProvider" class="Parthenon\Payments\Subscriber\CurrentSubscriberProvider">
<argument>%parthenon_payments_subscriber_type%</argument>
<argument type="service" id="Symfony\Component\Security\Core\Security" />
<argument type="service" id="Symfony\Bundle\SecurityBundle\Security" />
<argument type="service" id="Parthenon\User\Team\CurrentTeamProviderInterface" />
</service>
<service id="Parthenon\Payments\Subscriber\CurrentSubscriberProviderInterface" alias="Parthenon\Payments\Subscriber\CurrentSubscriberProvider" />
Expand Down
Loading

0 comments on commit 9791922

Please sign in to comment.