Skip to content

Commit

Permalink
Merge pull request #204 from loic425/features/improve-services-config…
Browse files Browse the repository at this point in the history
…uration

Improve services configuration
  • Loading branch information
loic425 committed Jul 29, 2019
2 parents e623578 + c822217 commit 4594299
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 46 deletions.
35 changes: 1 addition & 34 deletions config/services.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
imports:
- { resource: services/_main.yaml }
- { resource: services/command.yaml }
- { resource: services/context.yaml }
- { resource: services/fixtures.yaml }
Expand All @@ -8,37 +9,3 @@ imports:
- { resource: services/listener.yaml }
- { resource: services/menu.yaml }
- { resource: services/validator.yaml }

parameters:
email_contact: contact@app_name.com
email_name: Contact AppName
email_sender: no-reply@app_name.com

services:
# default configuration for services in *this* file
_defaults:
autoconfigure: true

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../src/Controller'
autowire: true
tags: ['controller.service_arguments']

App\Dashboard\:
resource: '../src/Dashboard'
autowire: true

sylius.controller.security:
class: Sylius\Bundle\UiBundle\Controller\SecurityController
public: true
arguments:
- "@security.authentication_utils"
- "@form.factory"
- "@templating.engine.twig"
- "@security.authorization_checker"
- "@router"

Sylius\Component\User\Canonicalizer\CanonicalizerInterface: '@sylius.canonicalizer'
Sylius\Component\User\Security\Generator\GeneratorInterface: '@sylius.app_user.token_generator.email_verification'
25 changes: 25 additions & 0 deletions config/services/_main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
parameters:
email_contact: contact@app_name.com
email_name: Contact AppName
email_sender: no-reply@app_name.com

services:
# default configuration for services in *this* file
_defaults:
autoconfigure: true
autowire: true

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
App\:
resource: '../../src/*'
exclude: '../../src/{DependencyInjection,Entity,Migrations,Tests,Kernel.php}'

# controllers are imported separately to make sure services can be injected
# as action arguments even if you don't extend any base controller class
App\Controller\:
resource: '../../src/Controller'
tags: ['controller.service_arguments']

Sylius\Component\User\Canonicalizer\CanonicalizerInterface: '@sylius.canonicalizer'
Sylius\Component\User\Security\Generator\GeneratorInterface: '@sylius.app_user.token_generator.email_verification'
3 changes: 3 additions & 0 deletions config/services/form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ services:

App\Form\EventSubscriber\CustomerRegistrationFormSubscriber: ~

App\Form\EventSubscriber\AddUserFormSubscriber:
autowire: false

App\Form\Type\User\AdminUserType:
arguments:
$dataClass: "%sylius.model.admin_user.class%"
Expand Down
12 changes: 0 additions & 12 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,6 @@
"monolog/monolog": {
"version": "1.23.0"
},
"muglug/package-versions-56": {
"version": "1.2.4"
},
"myclabs/deep-copy": {
"version": "1.8.1"
},
Expand Down Expand Up @@ -329,9 +326,6 @@
"phpdocumentor/type-resolver": {
"version": "0.4.0"
},
"phpmyadmin/sql-parser": {
"version": "v4.3.1"
},
"phpoption/phpoption": {
"version": "1.5.0"
},
Expand Down Expand Up @@ -410,9 +404,6 @@
"psr/log": {
"version": "1.0.2"
},
"psr/simple-cache": {
"version": "1.0.1"
},
"ralouphie/getallheaders": {
"version": "2.0.5"
},
Expand Down Expand Up @@ -569,9 +560,6 @@
"ref": "f3a28efb32f20b8740fd763651cabd780bce43da"
}
},
"symfony/contracts": {
"version": "v1.0.1"
},
"symfony/css-selector": {
"version": "v4.2.0"
},
Expand Down

0 comments on commit 4594299

Please sign in to comment.