Skip to content

Commit 4b8e9c0

Browse files
[WebLink] implement PSR-13 directly
1 parent 338aa95 commit 4b8e9c0

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

Controller/ControllerTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Controller;
1313

1414
use Doctrine\Common\Persistence\ManagerRegistry;
15-
use Fig\Link\GenericLinkProvider;
16-
use Fig\Link\Link;
1715
use Psr\Container\ContainerInterface;
16+
use Psr\Link\LinkInterface;
1817
use Symfony\Component\Form\Extension\Core\Type\FormType;
1918
use Symfony\Component\Form\FormBuilderInterface;
2019
use Symfony\Component\Form\FormInterface;
@@ -33,6 +32,7 @@
3332
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
3433
use Symfony\Component\Security\Csrf\CsrfToken;
3534
use Symfony\Component\WebLink\EventListener\AddLinkHeaderListener;
35+
use Symfony\Component\WebLink\GenericLinkProvider;
3636

3737
/**
3838
* Common features needed in controllers.
@@ -420,7 +420,7 @@ protected function dispatchMessage($message, array $stamps = []): Envelope
420420
*
421421
* @final
422422
*/
423-
protected function addLink(Request $request, Link $link)
423+
protected function addLink(Request $request, LinkInterface $link)
424424
{
425425
if (!class_exists(AddLinkHeaderListener::class)) {
426426
throw new \LogicException('You can not use the "addLink" method if the WebLink component is not available. Try running "composer require symfony/web-link".');

Tests/Controller/ControllerTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
1313

14-
use Fig\Link\Link;
1514
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
1615
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1716
use Symfony\Component\DependencyInjection\Container;
@@ -29,6 +28,7 @@
2928
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
3029
use Symfony\Component\Security\Core\User\User;
3130
use Symfony\Component\Serializer\SerializerInterface;
31+
use Symfony\Component\WebLink\Link;
3232

3333
abstract class ControllerTraitTest extends TestCase
3434
{

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
},
3232
"require-dev": {
3333
"doctrine/cache": "~1.0",
34-
"fig/link-util": "^1.0",
3534
"symfony/asset": "^3.4|^4.0|^5.0",
3635
"symfony/browser-kit": "^4.3|^5.0",
3736
"symfony/console": "^4.3|^5.0",
@@ -58,7 +57,7 @@
5857
"symfony/workflow": "^4.3|^5.0",
5958
"symfony/yaml": "^3.4|^4.0|^5.0",
6059
"symfony/property-info": "^3.4|^4.0|^5.0",
61-
"symfony/web-link": "^3.4|^4.0|^5.0",
60+
"symfony/web-link": "^4.4|^5.0",
6261
"doctrine/annotations": "~1.0",
6362
"phpdocumentor/reflection-docblock": "^3.0|^4.0",
6463
"twig/twig": "~1.34|~2.4"

0 commit comments

Comments
 (0)