Completed
Pull Request — develop (#329)
by Carsten
09:54
created
module/Jobs/src/Jobs/Controller/ConsoleController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
         }
37 37
 
38 38
         $date = new \DateTime('today');
39
-        $date->sub(new \DateInterval('P' . $days . 'D'));
39
+        $date->sub(new \DateInterval('P'.$days.'D'));
40 40
 
41
-        $query        = [
41
+        $query = [
42 42
             'status.name' => StatusInterface::ACTIVE,
43 43
             'datePublishStart.date' => ['$lt' => $date]
44 44
         ];
45 45
 
46 46
         $offset = 0;
47 47
         if ($limit && false !== strpos($limit, ',')) {
48
-            list($limit,$offset) = explode(',', $limit);
48
+            list($limit, $offset) = explode(',', $limit);
49 49
         }
50 50
 
51 51
         $jobs = $jobsRepo->findBy($query, null, (int) $limit, (int) $offset);
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         if ($info) {
59
-            echo count($jobs) , ' Jobs';
60
-            if ($offset) { echo ' starting from ' . $offset; }
61
-            echo PHP_EOL . PHP_EOL;
59
+            echo count($jobs), ' Jobs';
60
+            if ($offset) { echo ' starting from '.$offset; }
61
+            echo PHP_EOL.PHP_EOL;
62 62
             $this->listExpiredJobs($jobs);
63 63
             return;
64 64
         }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         
71 71
         echo "$count jobs found, which have to expire ...\n";
72 72
         
73
-        $progress     = new ProgressBar(
73
+        $progress = new ProgressBar(
74 74
             new ConsoleAdapter(
75 75
                 array(
76 76
                 'elements' => array(
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         /* @var \Jobs\Entity\Job $job */
95 95
         foreach ($jobs as $job) {
96
-            $progress->update($i++, 'Job ' . $i . ' / ' . $count);
96
+            $progress->update($i++, 'Job '.$i.' / '.$count);
97 97
 
98 98
             $job->changeStatus('expired');
99 99
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $i            = 0;
123 123
         /* @var Job $job */
124 124
         foreach ($jobs as $job) {
125
-            $progress->update($i++, 'Job ' . $i . ' / ' . $count);
125
+            $progress->update($i++, 'Job '.$i.' / '.$count);
126 126
             
127 127
             $permissions = $job->getPermissions();
128 128
             $user        = $job->getUser();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 continue;
131 131
             }
132 132
             try {
133
-                $group       = $user->getGroup($job->getCompany());
133
+                $group = $user->getGroup($job->getCompany());
134 134
             } catch (\Exception $e) {
135 135
                 continue;
136 136
             }
@@ -169,13 +169,13 @@  discard block
 block discarded – undo
169 169
                 $org = $job->getCompany();
170 170
             }
171 171
             printf(
172
-                '%s   %s   %-30s   %-20s' . PHP_EOL,
172
+                '%s   %s   %-30s   %-20s'.PHP_EOL,
173 173
                 $job->getDatePublishStart()->format('Y-m-d'),
174 174
                 $id,
175 175
                 substr($job->getTitle(), 0, 30),
176 176
                 substr($org, 0, 20)
177 177
             );
178 178
         }
179
-        return count($jobs) . ' Jobs.';
179
+        return count($jobs).' Jobs.';
180 180
     }
181 181
 }
Please login to merge, or discard this patch.
Organizations/src/Organizations/ImageFileCache/ApplicationListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         // try get image from repository
67 67
         $image = $this->repository->find($id);
68 68
 
69
-        if (! $image) {
69
+        if (!$image) {
70 70
             // abort if image does not exist
71 71
             return;
72 72
         }
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/ImageFileCache/Manager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public function matchUri($uri)
86 86
     {
87
-        $pattern = '#^' . preg_quote($this->options->getUriPath(), '#') . '/[0-9a-z]/[0-9a-z]/([0-9a-z]+)\.[a-zA-Z]{3,4}$#';
87
+        $pattern = '#^'.preg_quote($this->options->getUriPath(), '#').'/[0-9a-z]/[0-9a-z]/([0-9a-z]+)\.[a-zA-Z]{3,4}$#';
88 88
         $matches = [];
89 89
         preg_match($pattern, $uri, $matches);
90 90
         
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         $dir = rtrim($dir, '/\\');
122 122
         
123
-        if (! is_dir($dir)) {
123
+        if (!is_dir($dir)) {
124 124
             $this->createDirectoryRecursively(dirname($dir));
125 125
             
126 126
             $oldUmask = umask(0);
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/ImageFileCache/ODMListener.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function getSubscribedEvents()
50 50
     {
51
-        if (! $this->manager->isEnabled()) {
51
+        if (!$this->manager->isEnabled()) {
52 52
             return [];
53 53
         }
54 54
         
@@ -66,19 +66,19 @@  discard block
 block discarded – undo
66 66
         $organization = $eventArgs->getDocument();
67 67
         
68 68
         // check for a organization instance
69
-        if (! $organization instanceof Organization) {
69
+        if (!$organization instanceof Organization) {
70 70
             return;
71 71
         }
72 72
         
73 73
         // check if the image has been changed
74
-        if (! $eventArgs->hasChangedField('image')) {
74
+        if (!$eventArgs->hasChangedField('image')) {
75 75
             return;
76 76
         }
77 77
         
78 78
         $image = $eventArgs->getOldValue('image');
79 79
         
80 80
         // check if any image existed
81
-        if (! $image instanceof OrganizationImage) {
81
+        if (!$image instanceof OrganizationImage) {
82 82
             return;
83 83
         }
84 84
         
Please login to merge, or discard this patch.
module/Organizations/src/Organizations/Options/ImageFileCacheOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     public function __construct($options = null)
47 47
     {
48
-        $this->filePath = __DIR__ . '/../../../../../public' . $this->uriPath;
48
+        $this->filePath = __DIR__.'/../../../../../public'.$this->uriPath;
49 49
         
50 50
         parent::__construct($options);
51 51
     }
Please login to merge, or discard this patch.
module/Organizations/Module.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function getConfig()
27 27
     {
28
-         return ModuleConfigLoader::load(__DIR__ . '/config');
28
+         return ModuleConfigLoader::load(__DIR__.'/config');
29 29
     }
30 30
     
31 31
     /**
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         return array(
40 40
             'Zend\Loader\StandardAutoloader' => array(
41 41
                 'namespaces' => array(
42
-                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
43
-                    'OrganizationsTest' => __DIR__ . '/test/' . 'OrganizationsTest'
42
+                    __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__,
43
+                    'OrganizationsTest' => __DIR__.'/test/'.'OrganizationsTest'
44 44
                 ),
45 45
             ),
46 46
         );
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $createJobListener->attachShared($sharedManager);
57 57
 
58 58
         if ($e->getRequest() instanceof \Zend\Http\Request) {
59
-            $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function (MvcEvent $event) {
59
+            $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, function(MvcEvent $event) {
60 60
                 $serviceManager = $event->getApplication()
61 61
                     ->getServiceManager();
62 62
                 $options = $serviceManager->get('Organizations/ImageFileCacheOptions');
Please login to merge, or discard this patch.
module/Applications/src/Applications/Controller/ApplyController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
                 throw new \RuntimeException('Invalid application id.');
92 92
             }
93 93
 
94
-            $action     = 'process';
94
+            $action = 'process';
95 95
 
96 96
             $routeMatch->setParam('action', $action);
97 97
         } else {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     {
183 183
         $this->response->setStatusCode(410);
184 184
         $model = new ViewModel(
185
-            [ 'content' => /*@translate*/ 'Invalid apply id']
185
+            ['content' => /*@translate*/ 'Invalid apply id']
186 186
         );
187 187
         $model->setTemplate('applications/error/not-found');
188 188
         return $model;
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
         }
361 361
 
362 362
         if ('previewmail' == $this->params()->fromQuery('do')) {
363
-            $this->mailer('Applications/CarbonCopy', [ 'application' => $application], true);
363
+            $this->mailer('Applications/CarbonCopy', ['application' => $application], true);
364 364
             $this->notification()->success(/*@translate*/ 'Mail has been send');
365 365
             return new JsonModel();
366 366
         }
367 367
 
368 368
         if ('sendmail' == $this->params()->fromQuery('do')) {
369
-            $jobEntity         = $application->getJob();
369
+            $jobEntity = $application->getJob();
370 370
 
371 371
             $mailData = array(
372 372
                 'application' => $application,
@@ -394,8 +394,8 @@  discard block
 block discarded – undo
394 394
             ->revoke($this->auth()->getUser(), PermissionsInterface::PERMISSION_CHANGE)
395 395
             ->inherit($application->getJob()->getPermissions());
396 396
 
397
-        $events   = $services->get('Applications/Events');
398
-        $events->trigger(ApplicationEvent::EVENT_APPLICATION_POST_CREATE, $this, [ 'application' => $application ]);
397
+        $events = $services->get('Applications/Events');
398
+        $events->trigger(ApplicationEvent::EVENT_APPLICATION_POST_CREATE, $this, ['application' => $application]);
399 399
 
400 400
         $model = new ViewModel(
401 401
             array(
Please login to merge, or discard this patch.
src/Core/Repository/DoctrineMongoODM/Event/RepositoryEventsSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
      */
92 92
     protected function injectAttachableEntityManager(AttachableEntityInterface $entity)
93 93
     {
94
-        if (! isset($this->attachableEntityManagerPrototype)) {
94
+        if (!isset($this->attachableEntityManagerPrototype)) {
95 95
             $this->attachableEntityManagerPrototype = new AttachableEntityManager($this->services->get('repositories'));
96 96
         }
97 97
         
Please login to merge, or discard this patch.
module/Core/src/Core/Entity/AttachableEntityManager.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
     {
54 54
         $className = get_class($entity);
55 55
         
56
-        if (! isset($key)) {
56
+        if (!isset($key)) {
57 57
             $key = $className;
58 58
         }
59 59
         
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $entityId = $entity->getId();
64 64
         
65 65
         // check if entity is not persisted
66
-        if (! $entityId) {
66
+        if (!$entityId) {
67 67
             // persist entity & retrieve its ID
68 68
             $this->repositories->getRepository($className)->store($entity);
69 69
             $entityId = $entity->getId();
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function getAttachedEntity($key)
83 83
     {
84
-        if (! isset($this->references[$key])) {
84
+        if (!isset($this->references[$key])) {
85 85
             return;
86 86
         }
87 87
         
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         $entity = $this->repositories->getRepository($reference['repository'])
90 90
             ->find($reference['id']);
91 91
         
92
-        if (! $entity) {
92
+        if (!$entity) {
93 93
             // remove reference if entity does not exists
94 94
             unset($this->references[$key]);
95 95
         }
Please login to merge, or discard this patch.