Passed
Push — master ( c58a40...6d37ad )
by Mathias
10:02 queued 04:27
created
module/Applications/src/Controller/ApplyController.php 3 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         $this->uploadHandler = $uploadHandler;
108 108
     }
109 109
 
110
-	/**
111
-	 * @param ContainerInterface $container
112
-	 *
113
-	 * @return ApplyController
114
-	 */
110
+    /**
111
+     * @param ContainerInterface $container
112
+     *
113
+     * @return ApplyController
114
+     */
115 115
     static public function factory(ContainerInterface $container)
116 116
     {
117 117
         $config            = $container->get('Config');
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
         );
134 134
     }
135 135
 
136
-	public function attachDefaultListeners()
137
-	{
138
-		parent::attachDefaultListeners();
139
-		$events = $this->getEventManager();
140
-		$events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
141
-		return $this;
142
-	}
136
+    public function attachDefaultListeners()
137
+    {
138
+        parent::attachDefaultListeners();
139
+        $events = $this->getEventManager();
140
+        $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
141
+        return $this;
142
+    }
143 143
 
144 144
     public function preDispatch(MvcEvent $e)
145 145
     {
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             ->getHybridAuth();
318 318
         /* @var $authProfile Hybrid_User_Profile */
319 319
         $authProfile = $hybridAuth->authenticate($network)
320
-           ->getUserProfile();
320
+            ->getUserProfile();
321 321
 
322 322
         /* @var AbstractProfile $profile */
323 323
         $profile = $this->plugin('Auth/SocialProfiles')->fetch($network);
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         }
371 371
 
372 372
         return $this->redirect()
373
-           ->toRoute('lang/apply', ['applyId' => $job->getApplyId()], $urlOptions);
373
+            ->toRoute('lang/apply', ['applyId' => $job->getApplyId()], $urlOptions);
374 374
     }
375 375
 
376 376
     public function processPreviewAction()
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
 
381 381
     public function processAction()
382 382
     {
383
-    	$params = $this->params();
383
+        $params = $this->params();
384 384
         $formName  = $params->fromQuery('form');
385 385
         $form      = $this->formContainer->getForm($formName);
386 386
         $postData  = $form->getOption('use_post_array') ? $params->fromPost() : array();
387 387
         $uploadHandler = $this->uploadHandler;
388 388
 
389
-	    //@TODO: [ZF3] option use_files_array is false by default
389
+        //@TODO: [ZF3] option use_files_array is false by default
390 390
         //$filesData = $form->getOption('use_files_array') ? $params->fromFiles() : array();
391 391
 
392 392
         $form->setData(array_merge($postData,$_FILES));
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
 
433 433
         return new JsonModel(
434 434
             array(
435
-	            'valid' => $form->isValid(),
436
-	            'content' => $content,
437
-	            'isApplicationValid' => $this->checkApplication($application)
435
+                'valid' => $form->isValid(),
436
+                'content' => $content,
437
+                'isApplicationValid' => $this->checkApplication($application)
438 438
             )
439 439
         );
440 440
     }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 throw new RuntimeException('Invalid application id.');
176 176
             }
177 177
 
178
-            $action     = 'process';
178
+            $action = 'process';
179 179
 
180 180
             $routeMatch->setParam('action', $action);
181 181
         } else {
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
 
261 261
         $container->setEntity($application);
262 262
         $this->configureContainer($container);
263
-        $this->formContainer     = $container;
263
+        $this->formContainer = $container;
264 264
     }
265 265
 
266 266
     public function jobNotFoundAction()
267 267
     {
268 268
         $this->response->setStatusCode(410);
269 269
         $model = new ViewModel(
270
-            [ 'content' => /*@translate*/ 'Invalid apply id']
270
+            ['content' => /*@translate*/ 'Invalid apply id']
271 271
         );
272 272
         $model->setTemplate('applications/error/not-found');
273 273
         return $model;
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 	    //@TODO: [ZF3] option use_files_array is false by default
390 390
         //$filesData = $form->getOption('use_files_array') ? $params->fromFiles() : array();
391 391
 
392
-        $form->setData(array_merge($postData,$_FILES));
393
-        if('contact.image' === $formName){
392
+        $form->setData(array_merge($postData, $_FILES));
393
+        if ('contact.image' === $formName) {
394 394
             $application = $uploadHandler->handleImageUpload($postData['applicationId'], $_FILES['image']);
395 395
             $form->getParent()->setEntity($application->getContact());
396 396
             $content = $this->viewHelper->get('form')->__invoke($form);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 'content' => $content,
400 400
                 'isApplicationValid' => $this->checkApplication($application)
401 401
             ]);
402
-        }elseif('attachments' === $formName){
402
+        }elseif ('attachments' === $formName) {
403 403
             $attachment = $uploadHandler->handleAttachmentUpload($postData['applicationId'], $_FILES['attachments']);
404 404
             $basepath = $this->viewHelper->get('basepath');
405 405
             $content = $basepath($attachment->getUri());
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                 'content' => $content,
410 410
                 'isApplicationValid' => $this->checkApplication($application)
411 411
             ]);
412
-        } else{
412
+        } else {
413 413
             if (!$form->isValid()) {
414 414
                 return new JsonModel(
415 415
                     array(
@@ -466,13 +466,13 @@  discard block
 block discarded – undo
466 466
         }
467 467
 
468 468
         if ('previewmail' == $this->params()->fromQuery('do')) {
469
-            $this->mailer('Applications/CarbonCopy', [ 'application' => $application], true);
469
+            $this->mailer('Applications/CarbonCopy', ['application' => $application], true);
470 470
             $this->notification()->success(/*@translate*/ 'Mail has been send');
471 471
             return new JsonModel();
472 472
         }
473 473
 
474 474
         if ('sendmail' == $this->params()->fromQuery('do')) {
475
-            $jobEntity         = $application->getJob();
475
+            $jobEntity = $application->getJob();
476 476
 
477 477
             $mailData = array(
478 478
                 'application' => $application,
@@ -503,8 +503,8 @@  discard block
 block discarded – undo
503 503
 
504 504
         $repositories->store($application);
505 505
 
506
-        $events   = $this->appEvents;
507
-        $events->trigger(ApplicationEvent::EVENT_APPLICATION_POST_CREATE, $this, [ 'application' => $application ]);
506
+        $events = $this->appEvents;
507
+        $events->trigger(ApplicationEvent::EVENT_APPLICATION_POST_CREATE, $this, ['application' => $application]);
508 508
 
509 509
         $model = new ViewModel(
510 510
             array(
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -399,7 +399,7 @@
 block discarded – undo
399 399
                 'content' => $content,
400 400
                 'isApplicationValid' => $this->checkApplication($application)
401 401
             ]);
402
-        }elseif('attachments' === $formName){
402
+        } elseif('attachments' === $formName){
403 403
             $attachment = $uploadHandler->handleAttachmentUpload($postData['applicationId'], $_FILES['attachments']);
404 404
             $basepath = $this->viewHelper->get('basepath');
405 405
             $content = $basepath($attachment->getUri());
Please login to merge, or discard this patch.
module/Applications/src/Entity/Attachment.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
     public function getUri(): string
34 34
     {
35
-        return "/file/Applications.Attachment/" . $this->id . "/" .urlencode($this->getMetadata()->getName());
35
+        return "/file/Applications.Attachment/".$this->id."/".urlencode($this->getMetadata()->getName());
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
module/Applications/src/Repository/Application.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -106,9 +106,9 @@  discard block
 block discarded – undo
106 106
     {
107 107
         $qb = $this->getPaginationQueryBuilder($params);
108 108
         $cursor = $qb->hydrate(false)
109
-                     ->select('_id')
110
-                     ->getQuery()
111
-                     ->execute();
109
+                        ->select('_id')
110
+                        ->getQuery()
111
+                        ->execute();
112 112
 
113 113
         $list = new PaginationList(array_keys(ArrayUtils::iteratorToArray($cursor)));
114 114
         return $list;
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
     {
138 138
         $auth=$this->getService('AuthenticationService');
139 139
         $qb=$this->createQueryBuilder()
140
-                  ->field("readBy")->notIn(array($auth->getUser()->getId()))
141
-                  ->field("job")->equals(new ObjectId($job->getId()));
140
+                    ->field("readBy")->notIn(array($auth->getUser()->getId()))
141
+                    ->field("job")->equals(new ObjectId($job->getId()));
142 142
         return $qb->getQuery()->execute();
143 143
     }
144 144
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,8 +135,8 @@
 block discarded – undo
135 135
      */
136 136
     public function loadUnreadApplicationsForJob($job)
137 137
     {
138
-        $auth=$this->getService('AuthenticationService');
139
-        $qb=$this->createQueryBuilder()
138
+        $auth = $this->getService('AuthenticationService');
139
+        $qb = $this->createQueryBuilder()
140 140
                   ->field("readBy")->notIn(array($auth->getUser()->getId()))
141 141
                   ->field("job")->equals(new ObjectId($job->getId()));
142 142
         return $qb->getQuery()->execute();
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Service/ImageSetHandlerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
         $file = __FILE__;
35 35
 
36 36
         $specs = [
37
-            ImageSetInterface::ORIGINAL => [100,100],
38
-            ImageSetInterface::THUMBNAIL => [100,100],
37
+            ImageSetInterface::ORIGINAL => [100, 100],
38
+            ImageSetInterface::THUMBNAIL => [100, 100],
39 39
         ];
40 40
         $imageData = [
41 41
             'tmp_name' => $file,
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Controller/FileControllerTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,17 +84,17 @@  discard block
 block discarded – undo
84 84
         $plugins->expects($this->any())
85 85
             ->method('get')
86 86
             ->willReturnMap([
87
-                ['acl',null,$this->aclPlugin],
88
-                ['params',null,$this->paramsPlugin]
87
+                ['acl', null, $this->aclPlugin],
88
+                ['params', null, $this->paramsPlugin]
89 89
             ])
90 90
         ;
91 91
 
92 92
         $this->paramsPlugin->expects($this->any())
93 93
             ->method('__invoke')
94 94
             ->willReturnMap([
95
-                [null,null,$this->paramsPlugin],
96
-                ['filestore',null,'store.entity'],
97
-                ['fileId',0,'dir/file.ext']
95
+                [null, null, $this->paramsPlugin],
96
+                ['filestore', null, 'store.entity'],
97
+                ['fileId', 0, 'dir/file.ext']
98 98
             ])
99 99
         ;
100 100
         $this->paramsPlugin->expects($this->any())
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         $this->fileManager->expects($this->any())
114 114
             ->method('findByID')
115
-            ->with('store\Entity\entity','dir/file')
115
+            ->with('store\Entity\entity', 'dir/file')
116 116
             ->willReturn(null)
117 117
         ;
118 118
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/Controller/FileControllerFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $container->expects($this->exactly(2))
37 37
             ->method('get')
38 38
             ->willReturnMap([
39
-                ['Core/File/Events',$coreFileEvents],
39
+                ['Core/File/Events', $coreFileEvents],
40 40
                 [FileManager::class, $fileManager]
41 41
             ])
42 42
         ;
Please login to merge, or discard this patch.
Core/test/CoreTest/Factory/Paginator/RepositoryAbstractFactoryTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
     public function serviceNamesProvider()
45 45
     {
46 46
         return [
47
-            [ 'Repository/Core/File', true ],
48
-            [ 'Core/File', true ],
49
-            [ 'Repository/NoModuleWillBeEverCalledThat/SomeEntity', false ],
50
-            [ 'ThisIsAHighlyUnCommonModuleName/ObscureEntity', false ],
47
+            ['Repository/Core/File', true],
48
+            ['Core/File', true],
49
+            ['Repository/NoModuleWillBeEverCalledThat/SomeEntity', false],
50
+            ['ThisIsAHighlyUnCommonModuleName/ObscureEntity', false],
51 51
         ];
52 52
     }
53 53
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             ->disableOriginalConstructor()
66 66
             ->getMock()
67 67
         ;
68
-        $method = "assert" . ($expected ? 'True' : 'False');
68
+        $method = "assert".($expected ? 'True' : 'False');
69 69
 
70 70
         $this->{$method}($this->target->canCreate($sm, $serviceName));
71 71
     }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     public function servicesProvider()
74 74
     {
75 75
         return [
76
-            [ 'Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false ],
77
-            [ 'Core/TestEntity', '\Core\Entity\TestEntity', [ 'testOption' => 'testValue' ], true ]
76
+            ['Repository/Core/TestEntity', '\Core\Entity\TestEntity', [], false],
77
+            ['Core/TestEntity', '\Core\Entity\TestEntity', ['testOption' => 'testValue'], true]
78 78
         ];
79 79
     }
80 80
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Factory/LazyControllerFactoryTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
         $container->expects($this->any())
59 59
             ->method('get')
60 60
             ->willReturnMap([
61
-                ['config',$config],
62
-                ['ModuleManager',$moduleManager],
63
-                ['repositories',$repositories],
64
-                ['Core/EventManager',$eventManager],
61
+                ['config', $config],
62
+                ['ModuleManager', $moduleManager],
63
+                ['repositories', $repositories],
64
+                ['Core/EventManager', $eventManager],
65 65
                 [FileManager::class, $fileManager]
66 66
             ])
67 67
         ;
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
     public function invokeTestProvider()
77 77
     {
78 78
         return [
79
-            ['Core/Index',IndexController::class],
80
-            ['Core/File',FileController::class],
81
-            ['Core/Content',ContentController::class],
79
+            ['Core/Index', IndexController::class],
80
+            ['Core/File', FileController::class],
81
+            ['Core/Content', ContentController::class],
82 82
         ];
83 83
     }
84 84
 
Please login to merge, or discard this patch.
module/Core/test/CoreTest/Entity/Hydrator/ImageSetHydratorTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         '@testInheritance' => ['as_reflection' => true],
54 54
     ];
55 55
 
56
-    private $inheritance = [ HydratorInterface::class ];
56
+    private $inheritance = [HydratorInterface::class];
57 57
 
58 58
     /**
59 59
      * @var MockObject|ImagineInterface
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
         ];
145 145
 
146 146
         $imageSpecs = [
147
-            ImageSetInterface::THUMBNAIL => [100,100],
148
-            'large' => [10000,10000],
149
-            'small' => [600,600],
147
+            ImageSetInterface::THUMBNAIL => [100, 100],
148
+            'large' => [10000, 10000],
149
+            'small' => [600, 600],
150 150
         ];
151 151
         $metadata = $this->getMockBuilder(ImageMetadata::class)
152 152
             ->setMethods(['setContentType', 'setBelongsTo', 'setKey'])
Please login to merge, or discard this patch.