Completed
Pull Request — develop (#359)
by Mathias
23:51
created
module/Jobs/src/Jobs/Controller/ImportController.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                         $entity = $repositoriesJob->findOneBy(array("applyId" => (string) $applyId));
83 83
                         if (!isset($entity)) {
84 84
                             // new Job (the more likely branch)
85
-                            $entity =$repositoriesJob->create(array("applyId" => (string) $applyId));
85
+                            $entity = $repositoriesJob->create(array("applyId" => (string) $applyId));
86 86
                         } else {
87 87
                             $createdJob = false;
88 88
                         }
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
                             $entity->getPermissions()->grant($group, PermissionsInterface::PERMISSION_VIEW);
126 126
                         }
127 127
                         $result['isSaved'] = true;
128
-                        $log->info('Jobs/manage/saveJob [user: ' . $user->login . ']:' . var_export($p, true));
128
+                        $log->info('Jobs/manage/saveJob [user: '.$user->login.']:'.var_export($p, true));
129 129
 
130 130
                         if (!empty($params->companyId)) {
131
-                            $companyId                = $params->companyId . $loginSuffix;
131
+                            $companyId                = $params->companyId.$loginSuffix;
132 132
                             $repOrganization          = $repositories->get('Organizations/Organization');
133 133
                             $hydratorManager          = $services->get('hydratorManager');
134 134
                             /* @var \Organizations\Entity\Hydrator\OrganizationHydrator $hydrator */
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                             $jobLocations->clear();
180 180
                             foreach ($locations as $locData) {
181 181
                                 $location = new Location();
182
-                                $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']);
182
+                                $coords = array_map(function($i) { return (float) $i; }, $locData['coordinates']);
183 183
                                 $location->setCountry($locData['country'])
184 184
                                          ->setRegion($locData['region'])
185 185
                                          ->setCity($locData['city'])
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                                                     break;
245 245
                                             }
246 246
                                             if (array_key_exists($portal, $result['portals'])) {
247
-                                                throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for ' . $portal);
247
+                                                throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for '.$portal);
248 248
                                             }
249 249
                                             $result['portals'][$portal] = $status;
250 250
                                         } else {
@@ -257,16 +257,16 @@  discard block
 block discarded – undo
257 257
                             }
258 258
                         }
259 259
                     } else {
260
-                        $log->info('Jobs/manage/saveJob [error: ' . $form->getMessages() . ']:' . var_export($p, true));
260
+                        $log->info('Jobs/manage/saveJob [error: '.$form->getMessages().']:'.var_export($p, true));
261 261
                         $result['valid Error'] = $form->getMessages();
262 262
                     }
263 263
                 }
264 264
             } else {
265
-                $log->info('Jobs/manage/saveJob [error: session lost]:' . var_export($p, true));
265
+                $log->info('Jobs/manage/saveJob [error: session lost]:'.var_export($p, true));
266 266
                 $result['message'] = 'session_id is lost';
267 267
             }
268 268
         } catch (\Exception $e) {
269
-            $result['message'] = 'exception occured: ' . $e->getMessage();
269
+            $result['message'] = 'exception occured: '.$e->getMessage();
270 270
         }
271 271
         //$services->get('Core/Log')->info('Jobs/manage/saveJob result:' . PHP_EOL . var_export($p, True));
272 272
         return new JsonModel($result);
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
                                 $location = new Location();
183 183
                                 $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']);
184 184
                                 $location->setCountry($locData['country'])
185
-                                         ->setRegion($locData['region'])
186
-                                         ->setCity($locData['city'])
187
-                                         ->setCoordinates(new Point($coords));
185
+                                            ->setRegion($locData['region'])
186
+                                            ->setCity($locData['city'])
187
+                                            ->setCoordinates(new Point($coords));
188 188
 
189 189
                                 $jobLocations->add($location);
190 190
                             }
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                                 /* @var $jobEvents \Zend\EventManager\EventManager */
216 216
                                 $jobEvents = $services->get('Jobs/Events');
217 217
                                 $jobEvent->setName(JobEvent::EVENT_JOB_ACCEPTED)
218
-                                         ->setTarget($this);
218
+                                            ->setTarget($this);
219 219
                                 $responses = $jobEvents->trigger($jobEvent);
220 220
                                 foreach ($responses as $response) {
221 221
                                     // responses from the portals
Please login to merge, or discard this patch.
module/Cv/src/Cv/Entity/Status.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     public function __construct($status = self::NONPUBLIC)
48 48
     {
49 49
         if (!isset(static::$orderMap[$status])) {
50
-            throw new \DomainException('Unknown status: ' . $status);
50
+            throw new \DomainException('Unknown status: '.$status);
51 51
         }
52 52
         
53 53
         $this->name = $status;
Please login to merge, or discard this patch.
module/Cv/src/Cv/Entity/StatusInterface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@
 block discarded – undo
16 16
 interface StatusInterface extends EntityInterface
17 17
 {
18 18
 
19
-    const NONPUBLIC =  /*@translate*/ 'private';
19
+    const NONPUBLIC = /*@translate*/ 'private';
20 20
 
21
-    const PUBLIC_TO_ALL =  /*@translate*/ 'public to all';
21
+    const PUBLIC_TO_ALL = /*@translate*/ 'public to all';
22 22
 
23 23
     public function __construct($status = self::NONPUBLIC);
24 24
 
Please login to merge, or discard this patch.
module/Core/src/Core/Controller/Plugin/CreatePaginator.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,16 +90,16 @@
 block discarded – undo
90 90
         /* @var \Zend\Paginator\Paginator $paginator */
91 91
         /* @var CreatePaginatorEvent $event */
92 92
         $events = $this->serviceManager->get('Core/CreatePaginator/Events');
93
-        $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR,$this,[
93
+        $event = $events->getEvent(CreatePaginatorEvent::EVENT_CREATE_PAGINATOR, $this, [
94 94
             'paginatorParams' => $params,
95 95
             'paginators' => $paginators,
96 96
             'paginatorName' => $paginatorName
97 97
         ]);
98 98
         $events->trigger($event);
99 99
         $paginator = $event->getPaginator();
100
-        if(!$paginator instanceof Paginator){
100
+        if (!$paginator instanceof Paginator) {
101 101
             // no paginator created by listener, so let's create default paginator
102
-            $paginator = $paginators->get($paginatorName,$params);
102
+            $paginator = $paginators->get($paginatorName, $params);
103 103
         }
104 104
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
105 105
                   ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
             $paginator = $paginators->get($paginatorName,$params);
109 109
         }
110 110
         $paginator->setCurrentPageNumber(isset($params['page']) ? $params['page'] : 1)
111
-                  ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
112
-                  ->setPageRange(isset($params['range']) ? $params['range'] : 5);
111
+                    ->setItemCountPerPage(isset($params['count']) ? $params['count'] : 10)
112
+                    ->setPageRange(isset($params['range']) ? $params['range'] : 5);
113 113
 
114 114
         return $paginator;
115 115
     }
Please login to merge, or discard this patch.
module/Core/src/Core/Listener/Events/CreatePaginatorEvent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,16 +125,16 @@
 block discarded – undo
125 125
 
126 126
     public function setParams($params)
127 127
     {
128
-        if(is_array($params)){
129
-            if(isset($params['paginatorParams'])){
128
+        if (is_array($params)) {
129
+            if (isset($params['paginatorParams'])) {
130 130
                 $this->setPaginatorParams($params['paginatorParams']);
131 131
                 unset($params['paginatorParams']);
132 132
             }
133
-            if(isset($params['paginators'])){
133
+            if (isset($params['paginators'])) {
134 134
                 $this->setPaginators($params['paginators']);
135 135
                 unset($params['paginators']);
136 136
             }
137
-            if(isset($params['paginatorName'])){
137
+            if (isset($params['paginatorName'])) {
138 138
                 $this->setPaginatorName($params['paginatorName']);
139 139
                 unset($params['paginatorName']);
140 140
             }
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Entity/Organization.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function getParent($returnSelf = false)
235 235
     {
236
-        return $this->parent ? : ($returnSelf ? $this : null);
236
+        return $this->parent ?: ($returnSelf ? $this : null);
237 237
     }
238 238
 
239 239
     /**
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
      */
466 466
     public function getPermissionsResourceId()
467 467
     {
468
-        return 'organization:' . $this->getId();
468
+        return 'organization:'.$this->getId();
469 469
     }
470 470
 
471 471
     /**
Please login to merge, or discard this patch.
module/Cv/src/Cv/Options/ModuleOptions.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      *
35 35
      * @var array $attachmentsMimeType
36 36
      */
37
-    protected $attachmentsMimeType = array('image','applications/pdf',
37
+    protected $attachmentsMimeType = array('image', 'applications/pdf',
38 38
         'application/x-pdf',
39 39
         'application/acrobat',
40 40
         'applications/vnd.pdf',
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
     /**
94 94
      * Gets the the maximum number of allowed attachments
95 95
      *
96
-     * @return string
96
+     * @return integer
97 97
      */
98 98
     public function getAttachmentsCount()
99 99
     {
Please login to merge, or discard this patch.
module/Cv/src/Cv/Controller/ManageController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,7 @@
 block discarded – undo
109 109
                 if ('file-uri' === $params->fromPost('return')) {
110 110
                     $content = $viewHelperManager->get('basepath')
111 111
                         ->__invoke($form->getHydrator()->getLastUploadedFile()->getUri());
112
-                }
113
-                else {
112
+                } else {
114 113
                     if ($form instanceof SummaryFormInterface) {
115 114
                         $form->setRenderMode(SummaryFormInterface::RENDER_SUMMARY);
116 115
                         $viewHelper = 'summaryform';
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -173,6 +173,9 @@
 block discarded – undo
173 173
         return $this->redirect()->refresh();
174 174
     }
175 175
 
176
+    /**
177
+     * @param \Cv\Repository\Cv $repository
178
+     */
176 179
     private function getCv($repository, $user)
177 180
     {
178 181
         $id =
Please login to merge, or discard this patch.
module/Auth/src/Auth/Listener/UnauthorizedAccessListener.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
         if ($exception instanceof UnauthorizedImageAccessException) {
58 58
             $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png';
59 59
             $response->setStatusCode(Response::STATUS_CODE_403)
60
-                     ->setContent(file_get_contents($image))
61
-                     ->getHeaders()
62
-                     ->addHeaderLine('Content-Type', 'image/png');
60
+                        ->setContent(file_get_contents($image))
61
+                        ->getHeaders()
62
+                        ->addHeaderLine('Content-Type', 'image/png');
63 63
             $e->stopPropagation();
64 64
             $response->sendHeaders();
65 65
             //echo file_get_contents($image);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         }
71 71
         
72 72
         $application = $e->getApplication();
73
-		$auth = $application->getServiceManager()->get('AuthenticationService');
73
+        $auth = $application->getServiceManager()->get('AuthenticationService');
74 74
         
75 75
         if (!$auth->hasIdentity()) {
76 76
             $routeMatch = $e->getRouteMatch();
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
         $model->setTemplate($this->getExceptionTemplate());
103 103
         $e->setResult($model);
104 104
 
105
-       // $statusCode = $response->getStatusCode();
106
-       // if ($statusCode === 200) {
105
+        // $statusCode = $response->getStatusCode();
106
+        // if ($statusCode === 200) {
107 107
             $response->setStatusCode(Response::STATUS_CODE_403);
108
-       // }
108
+        // }
109 109
     }
110 110
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
          * Return an image, if an image was requested.
56 56
          */
57 57
         if ($exception instanceof UnauthorizedImageAccessException) {
58
-            $image = __DIR__ . '/../../../../../public/images/unauthorized-access.png';
58
+            $image = __DIR__.'/../../../../../public/images/unauthorized-access.png';
59 59
             $response->setStatusCode(Response::STATUS_CODE_403)
60 60
                      ->setContent(file_get_contents($image))
61 61
                      ->getHeaders()
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $routeMatch->setParam('action', 'index');
79 79
             $query = $e->getRequest()->getQuery();
80 80
             $ref = $e->getRequest()->getRequestUri();
81
-            $ref = preg_replace('~^' . preg_quote($e->getRouter()->getBaseUrl()) . '~', '', $ref);
81
+            $ref = preg_replace('~^'.preg_quote($e->getRouter()->getBaseUrl()).'~', '', $ref);
82 82
             $query->set('ref', $ref);
83 83
             $query->set('req', 1);
84 84
             $response->setStatusCode(Response::STATUS_CODE_401);
Please login to merge, or discard this patch.