@@ -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 |
@@ -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; |
@@ -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,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); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function getConsoleBanner(Console $console) |
42 | 42 | { |
43 | 43 | $version = `git describe 2>/dev/null`; |
44 | - $name = 'YAWIK ' . trim($version); |
|
44 | + $name = 'YAWIK '.trim($version); |
|
45 | 45 | $width = $console->getWidth(); |
46 | 46 | return sprintf( |
47 | 47 | "==%1\$s==\n%2\$s%3\$s\n**%1\$s**\n", |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | /* @var \Core\Options\ModuleOptions $options */ |
86 | 86 | $languageRouteListener = new LanguageRouteListener( |
87 | - $sm->get('Core/Locale'),$sm->get('Core/Options') |
|
87 | + $sm->get('Core/Locale'), $sm->get('Core/Options') |
|
88 | 88 | ); |
89 | 89 | $languageRouteListener->attach($eventManager); |
90 | 90 | |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | |
114 | 114 | $eventManager->attach( |
115 | 115 | MvcEvent::EVENT_DISPATCH_ERROR, |
116 | - function ($event) { |
|
117 | - if($event instanceof MvcEvent){ |
|
116 | + function($event) { |
|
117 | + if ($event instanceof MvcEvent) { |
|
118 | 118 | $application = $event->getApplication(); |
119 | 119 | |
120 | 120 | if ($application::ERROR_EXCEPTION == $event->getError()) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | ); |
130 | 130 | $eventManager->attach( |
131 | 131 | MvcEvent::EVENT_DISPATCH, |
132 | - function ($event) use ($eventManager) { |
|
132 | + function($event) use ($eventManager) { |
|
133 | 133 | $eventManager->trigger('postDispatch', $event); |
134 | 134 | }, |
135 | 135 | -150 |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function getConfig() |
146 | 146 | { |
147 | - $config = include __DIR__ . '/config/module.config.php'; |
|
147 | + $config = include __DIR__.'/config/module.config.php'; |
|
148 | 148 | return $config; |
149 | 149 | } |
150 | 150 | |
@@ -157,13 +157,13 @@ discard block |
||
157 | 157 | { |
158 | 158 | return array( |
159 | 159 | 'Zend\Loader\ClassMapAutoloader' => [ |
160 | - __DIR__ . '/src/autoload_classmap.php' |
|
160 | + __DIR__.'/src/autoload_classmap.php' |
|
161 | 161 | ], |
162 | 162 | 'Zend\Loader\StandardAutoloader' => array( |
163 | 163 | 'namespaces' => array( |
164 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
165 | - 'CoreTest' => __DIR__ . '/test/' . 'CoreTest', |
|
166 | - 'CoreTestUtils' => __DIR__ . '/test/CoreTestUtils', |
|
164 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
165 | + 'CoreTest' => __DIR__.'/test/'.'CoreTest', |
|
166 | + 'CoreTestUtils' => __DIR__.'/test/CoreTestUtils', |
|
167 | 167 | ), |
168 | 168 | ), |
169 | 169 | ); |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | $router = $e->getRouter(); |
127 | - $basePath=$router->getBaseUrl(); |
|
127 | + $basePath = $router->getBaseUrl(); |
|
128 | 128 | $match = []; |
129 | 129 | |
130 | - if (preg_match('~^' . $basePath . '/([a-z]{2})(?:/|$)~', $e->getRequest()->getRequestUri(), $match)) { |
|
130 | + if (preg_match('~^'.$basePath.'/([a-z]{2})(?:/|$)~', $e->getRequest()->getRequestUri(), $match)) { |
|
131 | 131 | /* It seems we have already a language in the URI |
132 | 132 | * Now there are two possibilities: |
133 | 133 | * |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | $options = $this->moduleOptions; |
163 | 163 | // using default language if detect language is disabled |
164 | - $lang = $options->isDetectLanguage() ? $this->detectLanguage($e):$options->getDefaultLanguage(); |
|
164 | + $lang = $options->isDetectLanguage() ? $this->detectLanguage($e) : $options->getDefaultLanguage(); |
|
165 | 165 | $langUri = rtrim("$basePath/$lang$origUri", '/'); |
166 | 166 | if ($router->match($request->setUri($langUri)) instanceof RouteMatch) { |
167 | 167 | $e->stopPropagation(true); |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | setlocale( |
213 | 213 | LC_ALL, |
214 | 214 | array( |
215 | - $locale . ".utf8", |
|
216 | - $locale . ".iso88591", |
|
215 | + $locale.".utf8", |
|
216 | + $locale.".iso88591", |
|
217 | 217 | $locale, |
218 | 218 | substr($locale, 0, 2), |
219 | 219 | 'de_DE.utf8', |
@@ -32,7 +32,7 @@ |
||
32 | 32 | { |
33 | 33 | $options = $this->options; |
34 | 34 | $filename = call_user_func($options->getCallback(), $this); |
35 | - $file = $options->getPath() . DIRECTORY_SEPARATOR . $filename; |
|
35 | + $file = $options->getPath().DIRECTORY_SEPARATOR.$filename; |
|
36 | 36 | |
37 | 37 | |
38 | 38 | $contents = $message->toString(); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class MailServiceFactory implements FactoryInterface |
28 | 28 | { |
29 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
29 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
30 | 30 | { |
31 | 31 | $config = $container->get('Config'); |
32 | 32 | $mails = isset($config['mails']) ? $config['mails'] : []; |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $configArray = array_merge($configArray, $mails); |
49 | 49 | |
50 | 50 | $config = new MailServiceConfig($configArray); |
51 | - $service = new MailService($container,$config->toArray()); |
|
51 | + $service = new MailService($container, $config->toArray()); |
|
52 | 52 | $config->configureServiceManager($service); |
53 | - foreach($config->toArray() as $name=>$value){ |
|
53 | + foreach ($config->toArray() as $name=>$value) { |
|
54 | 54 | $method = 'set'.$name; |
55 | - if(method_exists($service,$method)){ |
|
56 | - call_user_func([$service,$method],$value); |
|
55 | + if (method_exists($service, $method)) { |
|
56 | + call_user_func([$service, $method], $value); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | $type = $mailServiceOptions->getTransportClass(); |
66 | 66 | if (MailService::TRANSPORT_SMTP == $type) { |
67 | 67 | return new Smtp($mailServiceOptions); |
68 | - }elseif(MailService::TRANSPORT_FILE == $type){ |
|
68 | + }elseif (MailService::TRANSPORT_FILE == $type) { |
|
69 | 69 | $fileOptions = new FileOptions(); |
70 | 70 | $fileOptions->setPath($mailServiceOptions->getPath()); |
71 | 71 | return new FileTransport($fileOptions); |
72 | - }elseif(MailService::TRANSPORT_SENDMAIL == $type){ |
|
72 | + }elseif (MailService::TRANSPORT_SENDMAIL == $type) { |
|
73 | 73 | return new Sendmail(); |
74 | 74 | } |
75 | 75 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 | |
102 | - public function getUsername(){ |
|
102 | + public function getUsername() { |
|
103 | 103 | return $this->connectionConfig['username']; |
104 | 104 | } |
105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $this; |
111 | 111 | } |
112 | 112 | |
113 | - public function getPassword(){ |
|
113 | + public function getPassword() { |
|
114 | 114 | return $this->connectionConfig['password']; |
115 | 115 | } |
116 | 116 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return $this; |
122 | 122 | } |
123 | 123 | |
124 | - public function getSsl(){ |
|
124 | + public function getSsl() { |
|
125 | 125 | return $this->connectionConfig['ssl']; |
126 | 126 | } |
127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this; |
131 | 131 | } |
132 | 132 | |
133 | - public function getTransportClass(){ |
|
133 | + public function getTransportClass() { |
|
134 | 134 | return $this->transportClass; |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getPath() |
141 | 141 | { |
142 | - if(is_null($this->path)){ |
|
142 | + if (is_null($this->path)) { |
|
143 | 143 | $this->setPath(sys_get_temp_dir().'/yawik/mails'); |
144 | 144 | } |
145 | 145 | return $this->path; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function setPath($path) |
153 | 153 | { |
154 | - if(!is_dir($path)){ |
|
155 | - mkdir($path,0777,true); |
|
156 | - chmod($path,0777); |
|
154 | + if (!is_dir($path)) { |
|
155 | + mkdir($path, 0777, true); |
|
156 | + chmod($path, 0777); |
|
157 | 157 | } |
158 | 158 | $this->path = $path; |
159 | 159 | return $this; |