@@ -31,17 +31,17 @@ |
||
31 | 31 | * @param array|null $options |
32 | 32 | * @return Notification |
33 | 33 | */ |
34 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
35 | - { |
|
36 | - $pluginManager = $container->get('ControllerPluginManager'); |
|
37 | - $flashMessenger = $pluginManager->get('FlashMessenger'); |
|
38 | - $translator = $container->get('translator'); |
|
34 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
35 | + { |
|
36 | + $pluginManager = $container->get('ControllerPluginManager'); |
|
37 | + $flashMessenger = $pluginManager->get('FlashMessenger'); |
|
38 | + $translator = $container->get('translator'); |
|
39 | 39 | |
40 | - $notificationListener = $container->get('Core/Listener/Notification'); |
|
41 | - $notification = new Notification($flashMessenger); |
|
42 | - $notification->setListener($notificationListener); |
|
43 | - $notification->setTranslator($translator); |
|
40 | + $notificationListener = $container->get('Core/Listener/Notification'); |
|
41 | + $notification = new Notification($flashMessenger); |
|
42 | + $notification->setListener($notificationListener); |
|
43 | + $notification->setTranslator($translator); |
|
44 | 44 | |
45 | - return $notification; |
|
46 | - } |
|
45 | + return $notification; |
|
46 | + } |
|
47 | 47 | } |
@@ -31,14 +31,14 @@ |
||
31 | 31 | * @param array|null $options |
32 | 32 | * @return Notification |
33 | 33 | */ |
34 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
34 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
35 | 35 | { |
36 | 36 | $pluginManager = $container->get('ControllerPluginManager'); |
37 | 37 | $flashMessenger = $pluginManager->get('FlashMessenger'); |
38 | 38 | $translator = $container->get('translator'); |
39 | 39 | |
40 | 40 | $notificationListener = $container->get('Core/Listener/Notification'); |
41 | - $notification = new Notification($flashMessenger); |
|
41 | + $notification = new Notification($flashMessenger); |
|
42 | 42 | $notification->setListener($notificationListener); |
43 | 43 | $notification->setTranslator($translator); |
44 | 44 |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function trigger($event, $target = null) |
75 | 75 | { |
76 | 76 | if (empty($this->_template) || !is_string($this->_template)) { |
77 | - throw new \InvalidArgumentException('ContentCollector must have a template-name'); |
|
77 | + throw new \InvalidArgumentException('ContentCollector must have a template-name'); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $responseCollection = $this->getController()->getEventManager()->trigger($event, $target); |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | $viewModel->setTemplate($this->_template); |
83 | 83 | foreach ($responseCollection as $i => $response) { |
84 | 84 | if (is_string($response)) { |
85 | - $template = $response; |
|
86 | - $response = new ViewModel(array('target' => $target)); |
|
87 | - $response->setTemplate($template); |
|
85 | + $template = $response; |
|
86 | + $response = new ViewModel(array('target' => $target)); |
|
87 | + $response->setTemplate($template); |
|
88 | 88 | } |
89 | 89 | $viewModel->addChild($response, $this->_captureTo . $i); |
90 | 90 | } |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $response = new ViewModel(array('target' => $target)); |
87 | 87 | $response->setTemplate($template); |
88 | 88 | } |
89 | - $viewModel->addChild($response, $this->_captureTo . $i); |
|
89 | + $viewModel->addChild($response, $this->_captureTo.$i); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | return $viewModel; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } elseif (isset($this->config['templateHalf'])) { |
226 | 226 | $template = $this->config['templateHalf']; |
227 | 227 | } else { |
228 | - throw new \InvalidArgumentException('No template provided for Mail.'); |
|
228 | + throw new \InvalidArgumentException('No template provided for Mail.'); |
|
229 | 229 | } |
230 | 230 | return $template; |
231 | 231 | } |
@@ -276,11 +276,11 @@ discard block |
||
276 | 276 | return $erg; |
277 | 277 | } |
278 | 278 | |
279 | - /** |
|
280 | - * @param ContainerInterface $container |
|
281 | - * |
|
282 | - * @return static |
|
283 | - */ |
|
279 | + /** |
|
280 | + * @param ContainerInterface $container |
|
281 | + * |
|
282 | + * @return static |
|
283 | + */ |
|
284 | 284 | public static function factory(ContainerInterface $container) |
285 | 285 | { |
286 | 286 | //@TODO: need to define transport to be use during ::send() |
@@ -153,18 +153,18 @@ discard block |
||
153 | 153 | $replyTo = $this->stringFromMailHeader($this->getReplyTo()); |
154 | 154 | |
155 | 155 | return str_pad($template, 30) |
156 | - . 'to: ' . str_pad($to, 50) |
|
157 | - . 'cc: ' . str_pad($cc, 50) |
|
158 | - . 'bcc: ' . str_pad($bcc, 50) |
|
159 | - . 'from: ' . str_pad($from, 50) |
|
160 | - . 'replyTo: ' . str_pad($replyTo, 50) |
|
156 | + . 'to: '.str_pad($to, 50) |
|
157 | + . 'cc: '.str_pad($cc, 50) |
|
158 | + . 'bcc: '.str_pad($bcc, 50) |
|
159 | + . 'from: '.str_pad($from, 50) |
|
160 | + . 'replyTo: '.str_pad($replyTo, 50) |
|
161 | 161 | //. str_pad(implode(',', ArrayUtils::iteratorToArray($this->getSender())),50) |
162 | - . 'subject: ' . str_pad($this->getSubject(), 50); |
|
162 | + . 'subject: '.str_pad($this->getSubject(), 50); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | public function template($template) |
166 | 166 | { |
167 | - $controller = get_class($this->controller); |
|
167 | + $controller = get_class($this->controller); |
|
168 | 168 | |
169 | 169 | $event = new Event(); |
170 | 170 | $eventManager = $this->eventManager; |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | $controllerIdentifier = strtolower(substr($controller, 0, strpos($controller, '\\'))); |
182 | 182 | $viewResolver = $this->viewResolver; |
183 | 183 | |
184 | - $templateHalf = 'mail/' . $template; |
|
184 | + $templateHalf = 'mail/'.$template; |
|
185 | 185 | $resource = $viewResolver->resolve($templateHalf); |
186 | 186 | |
187 | 187 | if (empty($resource)) { |
188 | - $templateFull = $controllerIdentifier . '/mail/' . $template; |
|
188 | + $templateFull = $controllerIdentifier.'/mail/'.$template; |
|
189 | 189 | $resource = $viewResolver->resolve($templateFull); |
190 | 190 | } |
191 | 191 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | unset($__vars[$key]); |
213 | 213 | } |
214 | 214 | } |
215 | - unset($__vars['content'],$__vars['controllerIdentifier'],$__vars['controller'],$__vars['resource'],$__vars['template'],$__vars['viewResolver']); |
|
215 | + unset($__vars['content'], $__vars['controllerIdentifier'], $__vars['controller'], $__vars['resource'], $__vars['template'], $__vars['viewResolver']); |
|
216 | 216 | $this->config = $__vars; |
217 | 217 | } |
218 | 218 | } |
@@ -237,20 +237,20 @@ discard block |
||
237 | 237 | if (isset($this->config['from'])) { |
238 | 238 | $from = $this->config['from']; |
239 | 239 | } else { |
240 | - $log->err('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
241 | - throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
240 | + $log->err('A from email address must be provided (Variable $from) in Template: '.$template); |
|
241 | + throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: '.$template); |
|
242 | 242 | } |
243 | 243 | if (isset($this->config['fromName'])) { |
244 | 244 | $fromName = $this->config['fromName']; |
245 | 245 | } else { |
246 | - $log->err('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
247 | - throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
246 | + $log->err('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
247 | + throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
248 | 248 | } |
249 | 249 | if (isset($this->config['subject'])) { |
250 | 250 | $subject = $this->config['subject']; |
251 | 251 | } else { |
252 | - $log->err('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
253 | - throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
252 | + $log->err('A subject must be provided (Variable $subject) in Template: '.$template); |
|
253 | + throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: '.$template); |
|
254 | 254 | } |
255 | 255 | $this->setFrom($from, $fromName); |
256 | 256 | $this->setSubject($subject); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $erg = true; |
272 | 272 | $log->info($this); |
273 | 273 | } catch (\Exception $e) { |
274 | - $log->err('Mail failure ' . $e->getMessage()); |
|
274 | + $log->err('Mail failure '.$e->getMessage()); |
|
275 | 275 | } |
276 | 276 | return $erg; |
277 | 277 | } |
@@ -288,6 +288,6 @@ discard block |
||
288 | 288 | $viewResolver = $container->get('ViewResolver'); |
289 | 289 | $eventManager = $container->get('EventManager'); |
290 | 290 | $moduleManager = $container->get('ModuleManager'); |
291 | - return new static($mailLog,$viewResolver,$eventManager,$moduleManager); |
|
291 | + return new static($mailLog, $viewResolver, $eventManager, $moduleManager); |
|
292 | 292 | } |
293 | 293 | } |
@@ -13,11 +13,11 @@ |
||
13 | 13 | */ |
14 | 14 | class ConfigFactory implements FactoryInterface |
15 | 15 | { |
16 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
17 | - { |
|
18 | - $config = $container->get('Config'); |
|
19 | - $plugin = new Config($config); |
|
16 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
17 | + { |
|
18 | + $config = $container->get('Config'); |
|
19 | + $plugin = new Config($config); |
|
20 | 20 | |
21 | - return $plugin; |
|
22 | - } |
|
21 | + return $plugin; |
|
22 | + } |
|
23 | 23 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | class ConfigFactory implements FactoryInterface |
15 | 15 | { |
16 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
16 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
17 | 17 | { |
18 | 18 | $config = $container->get('Config'); |
19 | 19 | $plugin = new Config($config); |
@@ -87,11 +87,11 @@ |
||
87 | 87 | return $sendMail ? $this->send($mail) : $mail; |
88 | 88 | } |
89 | 89 | |
90 | - /** |
|
91 | - * @param ContainerInterface $container |
|
92 | - * |
|
93 | - * @return Mailer |
|
94 | - */ |
|
90 | + /** |
|
91 | + * @param ContainerInterface $container |
|
92 | + * |
|
93 | + * @return Mailer |
|
94 | + */ |
|
95 | 95 | public static function factory(ContainerInterface $container) |
96 | 96 | { |
97 | 97 | return new static($container->get('Core/MailService')); |