1 | <?php |
||
21 | class ServiceCredentialsFactory |
||
22 | { |
||
23 | /** |
||
24 | * @var CredentialsMapper |
||
25 | */ |
||
26 | protected $credentialsMapper; |
||
27 | |||
28 | /** |
||
29 | * @var CredentialsInterface[] |
||
30 | */ |
||
31 | protected $serviceCredentials; |
||
32 | |||
33 | /** |
||
34 | * @param CredentialsMapper $credentialsMapper |
||
35 | */ |
||
36 | public function __construct(CredentialsMapper $credentialsMapper) |
||
40 | |||
41 | /** |
||
42 | * @param string $serviceName |
||
43 | * @param array $credentials |
||
44 | * @return $this |
||
45 | */ |
||
46 | public function addCredentialsForService($serviceName, $credentials) |
||
60 | |||
61 | /** |
||
62 | * Load sender`s notification services credentials |
||
63 | * |
||
64 | * @param string $filePath |
||
65 | * @return $this |
||
66 | */ |
||
67 | public function loadCredentialsFromFile($filePath) |
||
90 | |||
91 | /** |
||
92 | * Returns the list of names of notification services |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | public function getInitializedServices() |
||
100 | |||
101 | /** |
||
102 | * Returns credentials for notification service |
||
103 | * |
||
104 | * @param string $serviceName |
||
105 | * @throws DomainException |
||
106 | * @return CredentialsInterface |
||
107 | */ |
||
108 | public function getCredentialsByService($serviceName) |
||
118 | |||
119 | /** |
||
120 | * @param string $serviceName |
||
121 | * @return CredentialsInterface |
||
122 | */ |
||
123 | private function getCredentialsDTOByServiceName($serviceName) |
||
141 | } |
||
142 |