Skip to content

Commit

Permalink
Allow symfony 6 packages (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianSchmick authored Jun 19, 2023
1 parent 5f47216 commit 2cf4d73
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
include:
- { php-version: 7.2, symfony-locked-version: none, dependency-version: prefer-lowest }
- { php-version: 7.4, symfony-locked-version: 4.4.*, dependency-version: prefer-stable }
- { php-version: 7.4, symfony-locked-version: 5.3.*, dependency-version: prefer-stable }
- { php-version: 8.1, symfony-locked-version: none, dependency-version: prefer-stable }
name: PHPUnit (PHP ${{matrix.php-version}}, Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }})
steps:
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
"ext-json": "*",
"ext-mbstring": "*",
"psr/log": "^1.0.2",
"symfony/config": "^4.4|^5.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/config": "^4.4|^5.0|^6.0",
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/http-foundation": "^5.3|^6.0",
"symfony/http-kernel": "^4.4|^5.0|^6.0",
"thunderer/shortcode": "^0.6.5|^0.7",
"twig/twig": "^1.34|^2.0|^3.0"
},

"require-dev": {
"phpunit/phpunit": "^8.5|^9.5",
"symfony/browser-kit": "^4.4|^5.4",
"symfony/expression-language": "^4.4|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/expression-language": "^4.4|^5.0|^6.0",
"symfony/framework-bundle": "^5.3|^6.0",
"symfony/phpunit-bridge": ">= 6.0",
"symfony/routing": "^4.4|^5.0",
"symfony/twig-bundle": "^4.4|^5.0",
"symfony/yaml": "^4.4|^5.0"
"symfony/routing": "^4.4|^5.0|^6.0",
"symfony/twig-bundle": "^4.4|^5.0|^6.0",
"symfony/yaml": "^4.4|^5.0|^6.0"
},

"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/EmbeddedShortcodeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __invoke(ShortcodeInterface $shortcode)
'parameters' => json_encode($shortcode->getParameters()),
'renderer' => $this->renderer,
'shortcode' => $shortcode->getName(),
'url' => $this->requestStack->getMasterRequest() ? $this->requestStack->getMasterRequest()->getRequestUri() : '-',
'url' => $this->requestStack->getMainRequest() ? $this->requestStack->getMainRequest()->getRequestUri() : '-',
]
);

Expand Down
4 changes: 2 additions & 2 deletions src/Resources/config/guide-routing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="webfactory.shortcode.guide-list" path="/">
<default key="_controller">Webfactory\ShortcodeBundle\Controller\GuideController:listAction</default>
<default key="_controller">Webfactory\ShortcodeBundle\Controller\GuideController::listAction</default>
</route>

<route id="webfactory.shortcode.guide-detail" path="/{shortcode}/">
<default key="_controller">Webfactory\ShortcodeBundle\Controller\GuideController:detailAction</default>
<default key="_controller">Webfactory\ShortcodeBundle\Controller\GuideController::detailAction</default>
</route>

</routes>
4 changes: 2 additions & 2 deletions tests/Functional/EmbeddedShortcodeHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ private function processShortcodes(string $content, Request $request = null): st
self::bootKernel();

if ($request) {
static::$container->get(RequestStack::class)->push($request);
static::getContainer()->get(RequestStack::class)->push($request);
}

return EndToEndTestHelper::createFromContainer(static::$container)->processShortcode($content);
return EndToEndTestHelper::createFromContainer(static::getContainer())->processShortcode($content);
}
}
2 changes: 1 addition & 1 deletion tests/Functional/EndToEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function provideEsiShortcodes(): Generator
private function renderTwig(string $templateCode, array $context = [], Request $request = null): string
{
self::bootKernel();
$container = static::$container;
$container = static::getContainer();

$requestStack = $container->get(RequestStack::class);
$requestStack->push($request ?? new Request());
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ShortcodeDefinitionTestHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ShortcodeDefinitionTestHelperTest extends KernelTestCase
protected function setUp(): void
{
self::bootKernel();
$this->helper = static::$container->get(ShortcodeDefinitionTestHelper::class);
$this->helper = static::getContainer()->get(ShortcodeDefinitionTestHelper::class);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ShortcodeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function filter_returns_safe_html(): void
private function renderTemplate(string $template): string
{
self::bootKernel();
$container = static::$container;
$container = static::getContainer();

$twig = $container->get('twig');

Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ShortcodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function getUrlWithRenderedExample(/* array */ $customParameters = null)
$urlParameters['customParameters'] = $customParametersAsString;
}

return static::$container->get('router')->generate('webfactory.shortcode.guide-detail', $urlParameters);
return static::getContainer()->get('router')->generate('webfactory.shortcode.guide-detail', $urlParameters);
}

private function getCustomParametersAsString($customParametersAsMixed): ?string
Expand Down

0 comments on commit 2cf4d73

Please sign in to comment.