-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathservices_examples.services.yml
37 lines (31 loc) · 1.35 KB
/
services_examples.services.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
services:
# Very simple service that generates simple passwords.
password_generator_simple:
class: \Drupal\services_examples\PasswordGeneratorSimple
## -- Service Definition inheritance --
# Abstract password generator who's service definition should be inherited
# by other services.
password_generator_abstract_base:
abstract: true
class: \Drupal\services_examples\PasswordGeneratorAbstractBase
arguments:
- '@messenger'
calls:
- ['setLogger', ['@logger.factory'] ]
# Better password generated with cryptographically secure random numbers.
# Inherits 'arguments' and 'calls' from parent service definition.
password_generator_crypto_secure:
class: \Drupal\services_examples\PasswordGeneratorCryptoSecure
parent: password_generator_abstract_base
# Better password generator that only uses unambiguous characters.
# Inherits 'arguments' and 'calls' from parent service definition.
password_generator_unambiguous:
class: \Drupal\services_examples\PasswordGeneratorUnambiguous
parent: password_generator_abstract_base
# Example decorating a service.
password_generator_unambiguous_decoration:
class: \Drupal\services_examples\PasswordGeneratorUnambiguousDecoration
public: false
decorates: password_generator_unambiguous
arguments:
- '@password_generator_unambiguous_decoration.inner'