Skip to content

Commit 2b8102d

Browse files
committed
Merge pull request #88 from zicht/remove-sensio-framework-extra-bundle
Remove Sensio Framework Extra Bundle
2 parents dca6f70 + d976f4a commit 2b8102d

File tree

7 files changed

+21
-32
lines changed

7 files changed

+21
-32
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
### Added|Changed|Deprecated|Removed|Fixed|Security
99
Nothing so far
1010

11+
## 6.3.8 - 2024-02-27
12+
### Removed
13+
- Removed usage of Sensio Framework Extra Bundle features and thus the dependency
14+
on the `sensio/framework-extra-bundle` package.
15+
1116
## 6.3.7 - 2023-05-22
1217
### Fixed
1318
- Attribute check in button form template.

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"symfony/console": "^4.4",
1515
"sonata-project/doctrine-orm-admin-bundle": "^3.15",
1616
"zicht/framework-extra-bundle": "^9",
17-
"sensio/framework-extra-bundle": "^5",
1817
"twig/twig": "^2.9 || ^3"
1918
},
2019
"require-dev": {
@@ -23,16 +22,12 @@
2322
},
2423
"autoload": {
2524
"psr-4": {
26-
"Zicht\\Bundle\\AdminBundle\\": [
27-
"src/"
28-
]
25+
"Zicht\\Bundle\\AdminBundle\\": "src/"
2926
}
3027
},
3128
"autoload-dev": {
3229
"psr-4": {
33-
"ZichtTest\\Bundle\\AdminBundle\\": [
34-
"tests/"
35-
]
30+
"ZichtTest\\Bundle\\AdminBundle\\": "tests/"
3631
}
3732
},
3833
"minimum-stability": "stable",

src/Controller/QuicklistController.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
namespace Zicht\Bundle\AdminBundle\Controller;
77

8-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
98
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
10-
use Symfony\Component\HttpFoundation\JsonResponse;
119
use Symfony\Component\HttpFoundation\Request;
10+
use Symfony\Component\HttpFoundation\Response;
1211
use Symfony\Component\Routing\Annotation\Route;
1312

1413
/**
@@ -19,9 +18,7 @@ class QuicklistController extends AbstractController
1918
/**
2019
* Displays a quick list control for jumping to entries registered in the quick list service
2120
*
22-
* @return array|JsonResponse
23-
*
24-
* @Template("@ZichtAdmin/Quicklist/quicklist.html.twig")
21+
* @return Response
2522
* @Route("quick-list")
2623
*/
2724
public function quicklistAction(Request $request)
@@ -36,8 +33,6 @@ public function quicklistAction(Request $request)
3633
return new JsonResponse($quicklist->getResults($request->get('repo'), $request->get('pattern'), $language));
3734
}
3835

39-
return [
40-
'repos' => $quicklist->getRepositoryConfigs(),
41-
];
36+
return $this->render('@ZichtAdmin/Quicklist/quicklist.html.twig', ['repos' => $quicklist->getRepositoryConfigs()]);
4237
}
4338
}

src/Controller/RcController.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@
55

66
namespace Zicht\Bundle\AdminBundle\Controller;
77

8-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
8+
use Symfony\Component\HttpFoundation\Response;
9+
use Twig\Environment as TwigEnvironment;
910

1011
class RcController
1112
{
13+
/** @var TwigEnvironment */
14+
private $twig;
15+
1216
/**
1317
* @param array $configs
1418
*/
15-
public function __construct($configs)
19+
public function __construct(TwigEnvironment $twig, $configs)
1620
{
21+
$this->twig = $twig;
1722
$this->configs = $configs;
1823
}
1924

2025
/**
2126
* Renders all RC controls
2227
*
23-
* @return array
24-
*
25-
* @Template("@ZichtAdmin/Rc/controls.html.twig")
28+
* @return Response
2629
*/
2730
public function controlsAction()
2831
{
29-
return [
30-
'configs' => $this->configs,
31-
];
32+
return $this->twig->render('@ZichtAdmin/Rc/controls.html.twig', ['configs' => $this->configs]);
3233
}
3334
}

src/DependencyInjection/ZichtAdminExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function load(array $configs, ContainerBuilder $container)
4444

4545
if (isset($config['rc'])) {
4646
$loader->load('rc.xml');
47-
$container->getDefinition('zicht_admin.controller.rc')->replaceArgument(0, $config['rc']);
47+
$container->getDefinition('zicht_admin.controller.rc')->replaceArgument(1, $config['rc']);
4848
}
4949

5050
$container->getDefinition('zicht_admin.security.authorization.voter.admin_voter')

src/Resources/config/rc.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<services>
88
<service id="zicht_admin.controller.rc" class="Zicht\Bundle\AdminBundle\Controller\RcController" public="true">
9+
<argument type="service" id="twig" />
910
<argument /><!-- replaced by extension -->
1011
</service>
1112
</services>

tests/Controller/QuicklistControllerTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ public function setUp(): void
3434
$this->ql = $ql;
3535
}
3636

37-
public function testQuickListAction()
38-
{
39-
$req = new Request();
40-
$res = $this->controller->quicklistAction($req);
41-
42-
$this->assertEquals(['repos' => ['foo' => 'bar']], $res);
43-
}
44-
4537
public function testQuickListActionJson()
4638
{
4739
$req2 = new Request([

0 commit comments

Comments
 (0)