Refactored code

This commit is contained in:
Kevin Frantz
2019-04-14 14:44:04 +02:00
parent 8b06927936
commit 0e1d5ea024
6 changed files with 18 additions and 54 deletions

View File

@@ -28,16 +28,6 @@ use Infinito\Domain\FixtureManagement\FixtureSource\HelpFixtureSource;
*/
class UserMenuSubscriber extends AbstractEntityMenuSubscriber implements EventSubscriberInterface
{
/**
* @var string
*/
const LAYER_GET_ROUTE = 'infinito_api_rest_layer_read';
/**
* @var string
*/
const LAYER_CREATE_ROUTE = 'infinito_api_rest_layer_create';
/**
* @var TokenStorageInterface
*/
@@ -92,7 +82,7 @@ class UserMenuSubscriber extends AbstractEntityMenuSubscriber implements EventSu
$this->deleteAndAddToItem($menu, $slug);
}
if ($this->shouldShowFormatSelection($event)) {
$this->generateShowDropdown($menu, $event, self::LAYER_GET_ROUTE);
$this->generateShowDropdown($menu, $event, LayerController::LAYER_GET_ROUTE);
}
$this->generateUserDropdown($menu);
foreach ($this->fixtureSources as $fixtureSource) {
@@ -121,7 +111,7 @@ class UserMenuSubscriber extends AbstractEntityMenuSubscriber implements EventSu
private function getSourceItemConfigurationArray(string $identity, string $icon)
{
return [
'route' => self::LAYER_GET_ROUTE,
'route' => LayerController::LAYER_GET_ROUTE,
'routeParameters' => [
LayerController::IDENTITY_PARAMETER_KEY => $identity,
LayerController::FORMAT_PARAMETER_KEY => RESTResponseType::HTML,