Skip to content

Commit

Permalink
Symfony 4.2 updated and autowire enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cesurapp committed Dec 15, 2018
1 parent 00a375c commit e594fa4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
24 changes: 8 additions & 16 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
services:
_defaults:
public: false
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
public: false # Allows optimizing the container by removing unused services; this also means

# Render Service
pd_menu.render:
class: Pd\MenuBundle\Render\TwigRender
arguments: ['@twig']

# Item Process Service
pd_menu.process:
class: Pd\MenuBundle\Builder\ItemProcess
arguments: ['@router', '@security.authorization_checker', '@event_dispatcher']

# Twig Extension
pd_menu.twig_extension:
class: Pd\MenuBundle\Twig\MenuExtension
arguments: ['@pd_menu.render','@pd_menu.process','@service_container', '@translator']
tags: ['twig.extension']
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Pd\MenuBundle\:
resource: '../../*'
exclude: '../../{Entity,Migrations,Tests,Kernel.php}'
2 changes: 1 addition & 1 deletion Twig/MenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Pd\MenuBundle\Builder\ItemProcessInterface;
use Pd\MenuBundle\Builder\MenuInterface;
use Pd\MenuBundle\Render\RenderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Psr\Container\ContainerInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
Expand Down

0 comments on commit e594fa4

Please sign in to comment.