Skip to content

Commit d3c32cc

Browse files
committed
Fixing view data
1 parent 795189b commit d3c32cc

38 files changed

+155
-503
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\Controller;
12+
namespace Sulu\Bundle\FormBundle\Admin\Controller;
1313

1414
use Doctrine\ORM\EntityManager;
1515
use FOS\RestBundle\Controller\ControllerTrait;
16-
use FOS\RestBundle\Routing\ClassResourceInterface;
1716
use FOS\RestBundle\View\ViewHandler;
17+
use Sulu\Bundle\FormBundle\Admin\ListBuilder\DynamicListFactoryInterface;
1818
use Sulu\Bundle\FormBundle\Entity\Dynamic;
1919
use Sulu\Bundle\FormBundle\Entity\Form;
20-
use Sulu\Bundle\FormBundle\ListBuilder\DynamicListFactory;
2120
use Sulu\Bundle\FormBundle\Repository\DynamicRepository;
2221
use Sulu\Bundle\FormBundle\Repository\FormRepository;
2322
use Sulu\Bundle\MediaBundle\Media\Exception\MediaNotFoundException;
@@ -30,13 +29,13 @@
3029
/**
3130
* Controller to create dynamic form entries list.
3231
*/
33-
class DynamicController implements ClassResourceInterface
32+
class DynamicController
3433
{
3534
use ControllerTrait;
3635

3736
public function __construct(
3837
private DynamicRepository $dynamicRepository,
39-
private DynamicListFactory $dynamicListFactory,
38+
private DynamicListFactoryInterface $dynamicListFactory,
4039
private MediaManagerInterface $mediaManager,
4140
private EntityManager $entityManager,
4241
private FormRepository $formRepository,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\Controller;
12+
namespace Sulu\Bundle\FormBundle\Admin\Controller;
1313

1414
use FOS\RestBundle\View\ViewHandlerInterface;
1515
use Sulu\Bundle\FormBundle\Admin\FormAdmin;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\Controller;
12+
namespace Sulu\Bundle\FormBundle\Admin\Controller;
1313

1414
use FOS\RestBundle\Routing\ClassResourceInterface;
1515
use FOS\RestBundle\View\ViewHandlerInterface;

Admin/DynamicListAdmin.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,13 @@
1919

2020
class DynamicListAdmin extends Admin
2121
{
22-
public static function getPriority(): int
23-
{
24-
return -1024;
25-
}
26-
27-
/**
28-
* @var ViewBuilderFactoryInterface
29-
*/
30-
private $viewBuilderFactory;
31-
32-
/**
33-
* @var mixed[]
34-
*/
35-
private $config;
36-
3722
/**
3823
* @param mixed[] $config
3924
*/
40-
public function __construct(ViewBuilderFactoryInterface $viewBuilderFactory, array $config)
41-
{
42-
$this->viewBuilderFactory = $viewBuilderFactory;
43-
$this->config = $config;
25+
public function __construct(
26+
private ViewBuilderFactoryInterface $viewBuilderFactory,
27+
private array $config,
28+
) {
4429
}
4530

4631
public function configureViews(ViewCollection $viewCollection): void

Admin/FormAdmin.php

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,11 @@ class FormAdmin extends Admin
3737
public const EDIT_FORM_VIEW = 'sulu_form.edit_form';
3838
public const EDIT_FORM_DETAILS_VIEW = 'sulu_form.edit_form.details';
3939

40-
/**
41-
* @var SecurityCheckerInterface
42-
*/
43-
private $securityChecker;
44-
45-
/**
46-
* @var ViewBuilderFactoryInterface
47-
*/
48-
private $viewBuilderFactory;
49-
50-
/**
51-
* @var WebspaceManagerInterface
52-
*/
53-
private $webspaceManager;
54-
55-
/**
56-
* FormAdmin constructor.
57-
*/
5840
public function __construct(
59-
SecurityCheckerInterface $securityChecker,
60-
ViewBuilderFactoryInterface $viewBuilderFactory,
61-
WebspaceManagerInterface $webspaceManager
41+
private SecurityCheckerInterface $securityChecker,
42+
private ViewBuilderFactoryInterface $viewBuilderFactory,
43+
private WebspaceManagerInterface $webspaceManager
6244
) {
63-
$this->securityChecker = $securityChecker;
64-
$this->viewBuilderFactory = $viewBuilderFactory;
65-
$this->webspaceManager = $webspaceManager;
6645
}
6746

6847
public function configureNavigationItems(NavigationItemCollection $navigationItemCollection): void
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\ListBuilder;
12+
namespace Sulu\Bundle\FormBundle\Admin\ListBuilder;
1313

1414
use Sulu\Bundle\FormBundle\Entity\Dynamic;
1515
use Sulu\Bundle\FormBundle\Exception\InvalidListBuilderValueException;

ListBuilder/DynamicListBuilderInterface.php renamed to Admin/ListBuilder/DynamicListBuilderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\ListBuilder;
12+
namespace Sulu\Bundle\FormBundle\Admin\ListBuilder;
1313

1414
use Sulu\Bundle\FormBundle\Entity\Dynamic;
1515

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\ListBuilder;
12+
namespace Sulu\Bundle\FormBundle\Admin\ListBuilder;
1313

14+
use Sulu\Bundle\FormBundle\Admin\ListBuilder\DynamicListBuilderInterface;
15+
use Sulu\Bundle\FormBundle\Admin\ListBuilder\DynamicListFactoryInterface;
1416
use Sulu\Bundle\FormBundle\Entity\Dynamic;
1517
use Sulu\Bundle\FormBundle\Entity\Form;
1618
use Sulu\Bundle\FormBundle\Exception\BuilderNotFoundException;
@@ -99,7 +101,7 @@ protected function getBuilder(?string $alias = null): DynamicListBuilderInterfac
99101
}
100102

101103
if (!\array_key_exists($alias, $this->builders)) {
102-
throw new BuilderNotFoundException($alias);
104+
throw new BuilderNotFoundException($alias, array_keys($this->builders));
103105
}
104106

105107
return $this->builders[$alias];

ListBuilder/DynamicListFactoryInterface.php renamed to Admin/ListBuilder/DynamicListFactoryInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* with this source code in the file LICENSE.
1010
*/
1111

12-
namespace Sulu\Bundle\FormBundle\ListBuilder;
12+
namespace Sulu\Bundle\FormBundle\Admin\ListBuilder;
1313

1414
use Sulu\Bundle\FormBundle\Entity\Dynamic;
1515
use Sulu\Bundle\FormBundle\Entity\Form;

Command/FormGeneratorCommand.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ public function __construct(
3131
parent::__construct();
3232
}
3333

34-
protected function configure(): void
35-
{
36-
$this->setDescription('Generates a form with all basic form types');
37-
}
38-
3934
protected function execute(InputInterface $input, OutputInterface $output): int
4035
{
4136
$form = $this->loadTestForm() ?: new Form();

0 commit comments

Comments
 (0)