Skip to content

Commit

Permalink
Fix Symfony deprecations (#753)
Browse files Browse the repository at this point in the history
Bug: T357844
  • Loading branch information
samwilson authored Apr 1, 2024
1 parent 6d70e4f commit 6f71281
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/packages/framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ framework:
# Write session files to the var/ directory
# and make sure they're limited to the tool's own path on Toolforge.
session:
storage_id: Wikimedia\ToolforgeBundle\Service\NativeSessionStorage
storage_factory_id: session.storage.factory.native
save_path: "%kernel.project_dir%/var/sessions/%kernel.environment%"

# esi: true
Expand Down
2 changes: 1 addition & 1 deletion config/packages/test/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
test: true
session:
storage_id: session.storage.mock_file
storage_factory_id: session.storage.factory.mock_file
2 changes: 1 addition & 1 deletion config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
arguments:
$entryPoint: "%wiki_url%"
$client: '@MediaWiki\OAuthClient\Client'
$session: "@session"
$requestStack: "@request_stack"

App\Service\FileCache:
arguments:
Expand Down
10 changes: 5 additions & 5 deletions src/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;

class Kernel extends BaseKernel
{
Expand Down Expand Up @@ -60,13 +60,13 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
$loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
}

protected function configureRoutes(RouteCollectionBuilder $routes): void
protected function configureRoutes(RoutingConfigurator $routes): void
{
$confDir = $this->getProjectDir().'/config';

$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS, '/', 'glob');
$routes->import($confDir.'/{routes}/*'.self::CONFIG_EXTS);
$routes->import($confDir.'/{routes}/'.$this->environment.'/**/*'.self::CONFIG_EXTS);
$routes->import($confDir.'/{routes}'.self::CONFIG_EXTS);
}

public function boot():void
Expand Down
6 changes: 3 additions & 3 deletions src/Service/MediaWikiApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use MediaWiki\OAuthClient\Client as OauthClient;
use MediaWiki\OAuthClient\Token;
use stdClass;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Exception\HttpException;

/**
Expand All @@ -33,11 +33,11 @@ class MediaWikiApi
/**
* @param string $entryPoint Fully-qualified URL of the wiki's api.php
*/
public function __construct(string $entryPoint, OauthClient $client, Session $session)
public function __construct(string $entryPoint, OauthClient $client, RequestStack $requestStack)
{
$this->entryPoint = $entryPoint;
$this->oauthClient = $client;
$this->oauthAccessToken = $session->get('oauth.access_token');
$this->oauthAccessToken = $requestStack->getSession()->get('oauth.access_token');
}

/**
Expand Down

0 comments on commit 6f71281

Please sign in to comment.