Completed
Pull Request — develop (#462)
by ANTHONIUS
06:57
created
module/Core/Module.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
module/Core/src/Core/Listener/LanguageRouteListener.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
module/Core/config/module.config.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Zend\I18n\Translator\Resources;
17 17
 use Zend\ServiceManager\Factory\InvokableFactory;
18 18
 
19
-$doctrineConfig = include __DIR__ . '/doctrine.config.php';
19
+$doctrineConfig = include __DIR__.'/doctrine.config.php';
20 20
 
21 21
 
22 22
 return array(
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     'doctrine' => $doctrineConfig,
25 25
 
26 26
     'options' => [
27
-        'Core/MailServiceOptions' => [ 'class' => '\Core\Options\MailServiceOptions' ],
27
+        'Core/MailServiceOptions' => ['class' => '\Core\Options\MailServiceOptions'],
28 28
         ],
29 29
     
30 30
     'Core' => array(
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                      'name' => 'stream',
45 45
                     'priority' => 1000,
46 46
                     'options' => array(
47
-                         'stream' => __DIR__ .'/../../../log/yawik.log',
47
+                         'stream' => __DIR__.'/../../../log/yawik.log',
48 48
                     ),
49 49
                  ),
50 50
             ),
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                      'name' => 'stream',
56 56
                     'priority' => 1000,
57 57
                     'options' => array(
58
-                         'stream' => __DIR__ .'/../../../log/mails.log',
58
+                         'stream' => __DIR__.'/../../../log/mails.log',
59 59
                     ),
60 60
                  ),
61 61
             ),
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         'mode' => true, // true = production|false = development|null = autodetect|IP address(es) csv/array
73 73
         'bar' => false, // bool = enabled|Toggle nette diagnostics bar.
74 74
         'strict' => true, // bool = cause immediate death|int = matched against error severity
75
-        'log' => __DIR__ . '/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files)
75
+        'log' => __DIR__.'/../../../log/tracy', // path to log directory (this directory keeps error.log, snoozing mailsent file & html exception trace files)
76 76
         'email' => null, // in production mode notifies the recipient
77 77
         'email_snooze' => 900 // interval for sending email in seconds
78 78
     ],
@@ -199,16 +199,16 @@  discard block
 block discarded – undo
199 199
             'Core/JsonEntityHydrator' => 'Core\Entity\Hydrator\JsonEntityHydratorFactory',
200 200
             'Core/EntityHydrator' => 'Core\Entity\Hydrator\EntityHydratorFactory',
201 201
             'Core/Options' => 'Core\Factory\ModuleOptionsFactory',
202
-            'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class,'factory'],
203
-            'DefaultListeners' => ['Core\Listener\DefaultListener','factory'],
204
-            'templateProviderStrategy'   => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy','factory'],
205
-            'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class,'factory'],
202
+            'Core/DoctrineMongoODM/RepositoryEvents' => [\Core\Repository\DoctrineMongoODM\Event\RepositoryEventsSubscriber::class, 'factory'],
203
+            'DefaultListeners' => ['Core\Listener\DefaultListener', 'factory'],
204
+            'templateProviderStrategy'   => ['Core\Form\Hydrator\Strategy\TemplateProviderStrategy', 'factory'],
205
+            'Core/Listener/DeferredListenerAggregate' => [\Core\Listener\DeferredListenerAggregate::class, 'factory'],
206 206
             'Core/Listener/CreatePaginator' => 'Core\Listener\CreatePaginatorListener::factory',
207 207
             'Core/Locale' => 'Core\I18n\LocaleFactory',
208 208
             \Core\Listener\AjaxRouteListener::class => \Core\Factory\Listener\AjaxRouteListenerFactory::class,
209 209
             \Core\Listener\DeleteImageSetListener::class => \Core\Factory\Listener\DeleteImageSetListenerFactory::class,
210 210
             'Imagine' => \Core\Factory\Service\ImagineFactory::class,
211
-            'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class,'factory'],
211
+            'Core/Listener/Notification' => [\Core\Listener\NotificationListener::class, 'factory'],
212 212
         ),
213 213
         'abstract_factories' => array(
214 214
             'Core\Factory\OptionsAbstractFactory',
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         'translation_file_patterns' => array(
232 232
             [
233 233
                 'type' => 'gettext',
234
-                'base_dir' => __DIR__ . '/../language',
234
+                'base_dir' => __DIR__.'/../language',
235 235
                 'pattern' => '%s.mo',
236 236
             ],
237 237
             [
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
         ),
270 270
 	    'factories' => [
271 271
 	    	// @TODO: improve this factory
272
-		    'Core\Controller\Index' => [\Core\Controller\IndexController::class,'factory'],
273
-		    'Core/Admin' => [\Core\Controller\AdminController::class,'factory'],
274
-		    'Core\Controller\File'  => [\Core\Controller\FileController::class,'factory'],
272
+		    'Core\Controller\Index' => [\Core\Controller\IndexController::class, 'factory'],
273
+		    'Core/Admin' => [\Core\Controller\AdminController::class, 'factory'],
274
+		    'Core\Controller\File'  => [\Core\Controller\FileController::class, 'factory'],
275 275
 	    ],
276 276
         'abstract_factories' => [
277 277
 	        \Core\Factory\Controller\LazyControllerFactory::class
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
             'Core/SearchForm' => 'Core\Factory\Controller\Plugin\SearchFormFactory',
287 287
             'listquery' => 'Core\Controller\Plugin\ListQuery::factory',
288 288
             'mail' => 'Core\Controller\Plugin\Mail::factory',
289
-            'Core/Mailer' => ['Core\Controller\Plugin\Mailer','factory'],
290
-            'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class,'factory'],
291
-            'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class,'factory'],
289
+            'Core/Mailer' => ['Core\Controller\Plugin\Mailer', 'factory'],
290
+            'Core/CreatePaginator' => [\Core\Controller\Plugin\CreatePaginator::class, 'factory'],
291
+            'Core/PaginatorService' => [\Core\Controller\Plugin\CreatePaginatorService::class, 'factory'],
292 292
         ),
293 293
         'invokables' => array(
294 294
             'Core/FileSender' => 'Core\Controller\Plugin\FileSender',
@@ -318,32 +318,32 @@  discard block
 block discarded – undo
318 318
         'exception_template' => 'error/index',
319 319
         // Map template to files. Speeds up the lookup through the template stack.
320 320
         'template_map' => array(
321
-            'noscript-notice' => __DIR__ . '/../view/layout/_noscript-notice.phtml',
322
-            'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
323
-            'error/404' => __DIR__ . '/../view/error/404.phtml',
324
-            'error/403' => __DIR__ . '/../view/error/403.phtml',
325
-            'error/index' => __DIR__ . '/../view/error/index.phtml',
326
-            'main-navigation' => __DIR__ . '/../view/partial/main-navigation.phtml',
327
-            'pagination-control' => __DIR__ . '/../view/partial/pagination-control.phtml',
328
-            'core/loading-popup' => __DIR__ . '/../view/partial/loading-popup.phtml',
329
-            'core/notifications' => __DIR__ . '/../view/partial/notifications.phtml',
330
-            'form/core/buttons' => __DIR__ . '/../view/form/buttons.phtml',
331
-            'core/social-buttons' => __DIR__ . '/../view/partial/social-buttons.phtml',
332
-            'form/core/privacy' => __DIR__ . '/../view/form/privacy.phtml',
333
-            'core/form/permissions-fieldset' => __DIR__ . '/../view/form/permissions-fieldset.phtml',
334
-            'core/form/permissions-collection' => __DIR__ . '/../view/form/permissions-collection.phtml',
335
-            'core/form/container-view' => __DIR__ . '/../view/form/container.view.phtml',
336
-            'core/form/tree-manage.view' => __DIR__ . '/../view/form/tree-manage.view.phtml',
337
-            'core/form/tree-manage.form' => __DIR__ . '/../view/form/tree-manage.form.phtml',
338
-            'core/form/tree-add-item' => __DIR__ . '/../view/form/tree-add-item.phtml',
339
-            'mail/header' =>  __DIR__ . '/../view/mail/header.phtml',
340
-            'mail/footer' =>  __DIR__ . '/../view/mail/footer.phtml',
341
-            'mail/footer.en' =>  __DIR__ . '/../view/mail/footer.en.phtml',
321
+            'noscript-notice' => __DIR__.'/../view/layout/_noscript-notice.phtml',
322
+            'layout/layout' => __DIR__.'/../view/layout/layout.phtml',
323
+            'error/404' => __DIR__.'/../view/error/404.phtml',
324
+            'error/403' => __DIR__.'/../view/error/403.phtml',
325
+            'error/index' => __DIR__.'/../view/error/index.phtml',
326
+            'main-navigation' => __DIR__.'/../view/partial/main-navigation.phtml',
327
+            'pagination-control' => __DIR__.'/../view/partial/pagination-control.phtml',
328
+            'core/loading-popup' => __DIR__.'/../view/partial/loading-popup.phtml',
329
+            'core/notifications' => __DIR__.'/../view/partial/notifications.phtml',
330
+            'form/core/buttons' => __DIR__.'/../view/form/buttons.phtml',
331
+            'core/social-buttons' => __DIR__.'/../view/partial/social-buttons.phtml',
332
+            'form/core/privacy' => __DIR__.'/../view/form/privacy.phtml',
333
+            'core/form/permissions-fieldset' => __DIR__.'/../view/form/permissions-fieldset.phtml',
334
+            'core/form/permissions-collection' => __DIR__.'/../view/form/permissions-collection.phtml',
335
+            'core/form/container-view' => __DIR__.'/../view/form/container.view.phtml',
336
+            'core/form/tree-manage.view' => __DIR__.'/../view/form/tree-manage.view.phtml',
337
+            'core/form/tree-manage.form' => __DIR__.'/../view/form/tree-manage.form.phtml',
338
+            'core/form/tree-add-item' => __DIR__.'/../view/form/tree-add-item.phtml',
339
+            'mail/header' =>  __DIR__.'/../view/mail/header.phtml',
340
+            'mail/footer' =>  __DIR__.'/../view/mail/footer.phtml',
341
+            'mail/footer.en' =>  __DIR__.'/../view/mail/footer.en.phtml',
342 342
             //'startpage' => __DIR__ . '/../view/layout/startpage.phtml',
343 343
         ),
344 344
         // Where to look for view templates not mapped above
345 345
         'template_path_stack' => array(
346
-            __DIR__ . '/../view',
346
+            __DIR__.'/../view',
347 347
         ),
348 348
     ),
349 349
     'view_helpers' => array(
Please login to merge, or discard this patch.
module/Core/src/Core/Mail/FileTransport.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
module/Core/src/Core/Mail/MailServiceFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
module/Core/src/Core/Options/MailServiceOptions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
module/Behat/src/MailContext.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $core = $scope->getEnvironment()->getContext(CoreContext::class);
50 50
         /* @var FileTransport $transport */
51 51
         $transport = $core->getServiceManager()->get('Core/MailService')->getTransport();
52
-        $path = $transport->getOptions()->getPath() . '/*.eml';
52
+        $path = $transport->getOptions()->getPath().'/*.eml';
53 53
         foreach (glob($path) as $filename) {
54 54
             unlink($filename);
55 55
         }
@@ -105,25 +105,25 @@  discard block
 block discarded – undo
105 105
         $regex = '/.*('.preg_quote($text).').*/im';
106 106
         $matches = [];
107 107
         $multiMessages = false;
108
-        if(count($this->messages) > 1){
108
+        if (count($this->messages) > 1) {
109 109
             $multiMessages = true;
110 110
         }
111 111
         $content = "";
112
-        foreach($this->messages as $key=>$definition){
112
+        foreach ($this->messages as $key=>$definition) {
113 113
             $content = $definition['contents'];
114
-            if(preg_match($regex,$content,$match)){
114
+            if (preg_match($regex, $content, $match)) {
115 115
                 $matches[] = $match;
116 116
             }
117 117
         }
118
-        $failMessage = sprintf('Can not find text "%s" in any email sent',$text);
119
-        if(!$multiMessages){
118
+        $failMessage = sprintf('Can not find text "%s" in any email sent', $text);
119
+        if (!$multiMessages) {
120 120
             $failMessage = sprintf(
121 121
                 'Can not find text "%s" in sent email. Here\'s the email content: %s',
122 122
                 $text,
123 123
                 PHP_EOL.PHP_EOL.$content
124 124
             );
125 125
         }
126
-        Assert::true(count($matches)>0,$failMessage);
126
+        Assert::true(count($matches) > 0, $failMessage);
127 127
     }
128 128
 
129 129
     /**
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
 
137 137
         $path = $transport->getOptions()->getPath().'/*.eml';
138 138
 
139
-        foreach(glob($path) as $filename){
139
+        foreach (glob($path) as $filename) {
140 140
             $id = md5($filename);
141
-            if(!isset($this->messages[$id])){
141
+            if (!isset($this->messages[$id])) {
142 142
                 $contents = file_get_contents($filename);
143
-                $this->messages[$id]  = $this->parseEmail($contents);
143
+                $this->messages[$id] = $this->parseEmail($contents);
144 144
             }
145 145
         }
146 146
 
147 147
         Assert::true(
148
-            count($this->messages)>0,
148
+            count($this->messages) > 0,
149 149
             'No email have been sent'
150 150
         );
151 151
     }
@@ -153,33 +153,33 @@  discard block
 block discarded – undo
153 153
     private function parseEmail($contents)
154 154
     {
155 155
         $addresses = $this->parseEmailAddress($contents);
156
-        $subject =$this->parseSubject($contents);
156
+        $subject = $this->parseSubject($contents);
157 157
 
158 158
         $contents = strip_tags($contents);
159 159
         $contents = preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $contents);
160 160
 
161
-        return array_merge($addresses,$subject,['contents' => $contents]);
161
+        return array_merge($addresses, $subject, ['contents' => $contents]);
162 162
     }
163 163
 
164 164
     private function parseEmailAddress($contents)
165 165
     {
166 166
         // pattern to get email address
167
-        $radd =  '(\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}\b)';
167
+        $radd = '(\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}\b)';
168 168
 
169 169
         // get email from address
170
-        $regex = sprintf('/^From\:.*%s/im',$radd);
171
-        $hasMatch = preg_match($regex,$contents,$matches);
172
-        $fromAddress = $hasMatch ? $matches[1]:null;
170
+        $regex = sprintf('/^From\:.*%s/im', $radd);
171
+        $hasMatch = preg_match($regex, $contents, $matches);
172
+        $fromAddress = $hasMatch ? $matches[1] : null;
173 173
 
174 174
         // get email to address
175
-        $regex = sprintf('/^To\:\s+%s/im',$radd);
176
-        $hasMatch = preg_match($regex,$contents,$matches);
177
-        $toAddress1 = $hasMatch ? $matches[1]:null;
175
+        $regex = sprintf('/^To\:\s+%s/im', $radd);
176
+        $hasMatch = preg_match($regex, $contents, $matches);
177
+        $toAddress1 = $hasMatch ? $matches[1] : null;
178 178
 
179 179
         // get email to address
180
-        $regex = sprintf('/^To\:.*%s/im',$radd);
181
-        $hasMatch = preg_match($regex,$contents,$matches);
182
-        $toAddress2 = $hasMatch ? $matches[1]:null;
180
+        $regex = sprintf('/^To\:.*%s/im', $radd);
181
+        $hasMatch = preg_match($regex, $contents, $matches);
182
+        $toAddress2 = $hasMatch ? $matches[1] : null;
183 183
 
184 184
         $this->fromMails[] = $fromAddress;
185 185
         $this->toMails[] = $toAddress1;
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 
188 188
         return [
189 189
             'from' => $fromAddress,
190
-            'to' => [$toAddress1,$toAddress2],
190
+            'to' => [$toAddress1, $toAddress2],
191 191
         ];
192 192
     }
193 193
 
194 194
     private function parseSubject($contents)
195 195
     {
196 196
         $pattern = '/Subject\:(.*)/i';
197
-        preg_match($pattern,$contents,$matches);
198
-        $subject = isset($matches[1]) ? $matches[1]:null;
197
+        preg_match($pattern, $contents, $matches);
198
+        $subject = isset($matches[1]) ? $matches[1] : null;
199 199
         $this->subjects[] = $subject;
200 200
         return [
201 201
             'subject' => trim($subject)
Please login to merge, or discard this patch.
src/Organizations/Factory/Controller/ProfileControllerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,6 +32,6 @@
 block discarded – undo
32 32
         ;
33 33
         $translator = $container->get('translator');
34 34
         $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager');
35
-        return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager);
35
+        return new ProfileController($repo, $jobRepository, $translator, $imageFileCacheManager);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Controller/ProfileController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $repo            = $this->repo;
103 103
         $id              = $this->params('id');
104 104
 
105
-        if(is_null($id)){
105
+        if (is_null($id)) {
106 106
             $this->getResponse()->setStatusCode(Response::STATUS_CODE_404);
107 107
             return [
108 108
                 'message' => $translator->translate('Can not access profile page without id'),
@@ -111,33 +111,33 @@  discard block
 block discarded – undo
111 111
         }
112 112
 
113 113
         $organization = $repo->find($id);
114
-        if(!$organization instanceof Organization){
114
+        if (!$organization instanceof Organization) {
115 115
             throw new NotFoundException($id);
116 116
         }
117 117
 
118
-        if(
118
+        if (
119 119
             Organization::PROFILE_DISABLED == $organization->getProfileSetting()
120 120
             || is_null($organization->getProfileSetting())
121
-        ){
121
+        ) {
122 122
             throw new UnauthorizedAccessException(/*@translate*/ 'This Organization Profile is disabled');
123 123
         }
124 124
 
125 125
         $result = $this->pagination([
126 126
             'params' => [
127
-                'Organization_Jobs',[
127
+                'Organization_Jobs', [
128 128
                     'organization_id' => $organization->getId()
129 129
                 ]
130 130
             ],
131
-            'paginator' => ['as' => 'jobs','Organizations/ListJob'],
131
+            'paginator' => ['as' => 'jobs', 'Organizations/ListJob'],
132 132
         ]);
133 133
 
134
-        if(
134
+        if (
135 135
             Organization::PROFILE_ACTIVE_JOBS == $organization->getProfileSetting()
136
-        ){
136
+        ) {
137 137
             /* @var \Zend\Paginator\Paginator $paginator */
138 138
             $paginator = $result['jobs'];
139 139
             $count = $paginator->getTotalItemCount();
140
-            if(0===$count){
140
+            if (0 === $count) {
141 141
                 throw new UnauthorizedAccessException(/*@translate*/ 'This Organization Profile is disabled');
142 142
             }
143 143
         }
Please login to merge, or discard this patch.