@@ -35,10 +35,10 @@ |
||
35 | 35 | 'applications list' => 'list view scripts.', |
36 | 36 | 'applications reset-files-permissions [--filter=]' => 'Resets (means: Set again) the permissions of attachments and contact images', |
37 | 37 | array('--filter=JSON', "available keys:\n" |
38 | - . "- before ISODate only applications before the given date\n" |
|
39 | - . "- after ISODate only applications after the given date\n" |
|
40 | - . "- id String Mongo ID of the application\n" |
|
41 | - . "- isDraft Boolean "), |
|
38 | + . "- before ISODate only applications before the given date\n" |
|
39 | + . "- after ISODate only applications after the given date\n" |
|
40 | + . "- id String Mongo ID of the application\n" |
|
41 | + . "- isDraft Boolean "), |
|
42 | 42 | ); |
43 | 43 | } |
44 | 44 |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function getConfig() |
51 | 51 | { |
52 | - return ModuleConfigLoader::load(__DIR__ . '/config'); |
|
52 | + return ModuleConfigLoader::load(__DIR__.'/config'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | return array( |
63 | 63 | 'Zend\Loader\StandardAutoloader' => array( |
64 | 64 | 'namespaces' => array( |
65 | - __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, |
|
66 | - __NAMESPACE__ . 'Test' => __DIR__ . '/test/' . __NAMESPACE__ .'Test', |
|
65 | + __NAMESPACE__ => __DIR__.'/src/'.__NAMESPACE__, |
|
66 | + __NAMESPACE__.'Test' => __DIR__.'/test/'.__NAMESPACE__.'Test', |
|
67 | 67 | ), |
68 | 68 | ), |
69 | 69 | ); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $table = new Table( |
159 | 159 | array('columnWidths' => array(40, 40, 40), |
160 | - 'decorator' => 'ascii') |
|
160 | + 'decorator' => 'ascii') |
|
161 | 161 | ); |
162 | 162 | |
163 | 163 | $table->appendRow(array('Module', 'Name', 'Description')); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | $attachments = $app->getAttachments(); |
239 | 239 | foreach ($attachments as $attachment) { |
240 | 240 | $attachment->getPermissions() |
241 | - ->clear() |
|
242 | - ->inherit($permissions); |
|
241 | + ->clear() |
|
242 | + ->inherit($permissions); |
|
243 | 243 | } |
244 | 244 | $contact = $app->getContact(); |
245 | 245 | if ($contact) { |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | |
248 | 248 | if ($image) { |
249 | 249 | $image->getPermissions() |
250 | - ->clear() |
|
251 | - ->inherit($permissions); |
|
250 | + ->clear() |
|
251 | + ->inherit($permissions); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | echo "Generate keywords for $count applications ...\n"; |
63 | 63 | |
64 | - $progress = new ProgressBar($count); |
|
64 | + $progress = new ProgressBar($count); |
|
65 | 65 | |
66 | 66 | /** @var \Core\Repository\Filter\PropertyToKeywords $filter */ |
67 | 67 | $filter = $services->get('filtermanager')->get('Core/Repository/PropertyToKeywords'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | /** @var \Applications\Entity\Application $application */ |
71 | 71 | foreach ($applications as $application) { |
72 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
72 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
73 | 73 | $keywords = $filter->filter($application); |
74 | 74 | |
75 | 75 | $application->setKeywords($keywords); |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | { |
96 | 96 | $applications = $this->fetchApplications(); |
97 | 97 | $count = count($applications); |
98 | - $i=0; |
|
99 | - echo "Calculate rating for " . $count . " applications ...\n"; |
|
98 | + $i = 0; |
|
99 | + echo "Calculate rating for ".$count." applications ...\n"; |
|
100 | 100 | |
101 | 101 | $progress = new ProgressBar($count); |
102 | 102 | /** @var \Applications\Entity\Application $application */ |
103 | 103 | foreach ($applications as $application) { |
104 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
104 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
105 | 105 | $application->getRating(/* recalculate */ true); |
106 | 106 | } |
107 | 107 | $progress->update($i, 'Write to database...'); |
@@ -129,17 +129,17 @@ discard block |
||
129 | 129 | $documentManager = $services->get('Core/DocumentManager'); |
130 | 130 | |
131 | 131 | $count = count($applications); |
132 | - $i=0; |
|
132 | + $i = 0; |
|
133 | 133 | |
134 | - echo $count . " applications in Draft Mode and older than " . $days . " days will be deleted\n"; |
|
134 | + echo $count." applications in Draft Mode and older than ".$days." days will be deleted\n"; |
|
135 | 135 | |
136 | 136 | $progress = new ProgressBar($count); |
137 | 137 | |
138 | 138 | foreach ($applications as $application) { |
139 | - $progress->update($i++, 'Application ' . $i . ' / ' . $count); |
|
139 | + $progress->update($i++, 'Application '.$i.' / '.$count); |
|
140 | 140 | try { |
141 | 141 | $documentManager->remove($application); |
142 | - } catch (\Exception $e){ |
|
142 | + } catch (\Exception $e) { |
|
143 | 143 | // log something |
144 | 144 | $e->getCode(); |
145 | 145 | } |
@@ -163,17 +163,17 @@ discard block |
||
163 | 163 | |
164 | 164 | $table->appendRow(array('Module', 'Name', 'Description')); |
165 | 165 | |
166 | - $offset=strlen(getcwd())+1; |
|
167 | - $links=""; |
|
168 | - $github='https://github.com/cross-solution/YAWIK/blob/master/'; |
|
166 | + $offset = strlen(getcwd()) + 1; |
|
167 | + $links = ""; |
|
168 | + $github = 'https://github.com/cross-solution/YAWIK/blob/master/'; |
|
169 | 169 | |
170 | 170 | foreach ($config['view_manager']['template_map'] as $key => $absolute_filename) { |
171 | 171 | // strip the application_root plus an additional slash |
172 | - $filename=substr(realpath($absolute_filename), $offset); |
|
172 | + $filename = substr(realpath($absolute_filename), $offset); |
|
173 | 173 | if (preg_match('~module/([^/]+)~', $filename, $match)) { |
174 | - $module=$match[1]; |
|
174 | + $module = $match[1]; |
|
175 | 175 | } else { |
176 | - $module="not found ($key)"; |
|
176 | + $module = "not found ($key)"; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | $viewModel = new ViewModel(); |
@@ -182,17 +182,17 @@ discard block |
||
182 | 182 | $row = new Row(); |
183 | 183 | $row->appendColumn(new Column($module)); |
184 | 184 | if ($filename) { |
185 | - $row->appendColumn(new Column('`' . $key . '`_')); |
|
186 | - $links.='.. _'. $key .': '. $github.$filename .PHP_EOL; |
|
185 | + $row->appendColumn(new Column('`'.$key.'`_')); |
|
186 | + $links .= '.. _'.$key.': '.$github.$filename.PHP_EOL; |
|
187 | 187 | } else { |
188 | 188 | $row->appendColumn(new Column("WRONG CONFIGURATION")); |
189 | 189 | } |
190 | - $comment=""; |
|
190 | + $comment = ""; |
|
191 | 191 | if (file_exists($absolute_filename)) { |
192 | - $src=file_get_contents($absolute_filename); |
|
193 | - $comment="file exists"; |
|
192 | + $src = file_get_contents($absolute_filename); |
|
193 | + $comment = "file exists"; |
|
194 | 194 | if (preg_match("/{{rtd:\s*(.*)}}/", $src, $match)) { |
195 | - $comment=$match['1']; |
|
195 | + $comment = $match['1']; |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | $row->appendColumn(new Column($comment)); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | { |
210 | 210 | echo "Loading applications... "; |
211 | 211 | |
212 | - $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
212 | + $filter = \Zend\Json\Json::decode($this->params('filter', '{}'), \Zend\Json\Json::TYPE_ARRAY); |
|
213 | 213 | $filter['$or'] = array( |
214 | 214 | array('attachments' => array('$exists' => 1)), |
215 | 215 | array('contact.image' => array('$exists' => 1)), |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return; |
224 | 224 | } |
225 | 225 | $progress = new ProgressBar($count); |
226 | - $i=0; |
|
226 | + $i = 0; |
|
227 | 227 | |
228 | 228 | foreach ($applications as $app) { |
229 | 229 | $progress->update($i++, "Process $i / $count"); |
@@ -446,7 +446,7 @@ |
||
446 | 446 | public function getCv() |
447 | 447 | { |
448 | 448 | if (is_null($this->cv)) { |
449 | - $this->cv= new Cv(); |
|
449 | + $this->cv = new Cv(); |
|
450 | 450 | } |
451 | 451 | return $this->cv; |
452 | 452 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | /** |
21 | 21 | * A new application has been received |
22 | 22 | */ |
23 | - const INCOMING = 'incoming'; |
|
23 | + const INCOMING = 'incoming'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * An acknowledgement of receipt has been sent |
@@ -30,12 +30,12 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * An applicant ist invited to in interview |
32 | 32 | */ |
33 | - const INVITED = 'invited'; |
|
33 | + const INVITED = 'invited'; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * The applicant has been canceled |
37 | 37 | */ |
38 | - const REJECTED = 'rejected'; |
|
38 | + const REJECTED = 'rejected'; |
|
39 | 39 | |
40 | 40 | public function __construct($status = self::INCOMING); |
41 | 41 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @var string |
26 | 26 | */ |
27 | - protected $label = /*@translate*/ 'Cover Letter'; |
|
27 | + protected $label = /*@translate*/ 'Cover Letter'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * {@inheritDoc} |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $dm = $eventArgs->getDocumentManager(); |
43 | 43 | $uow = $dm->getUnitOfWork(); |
44 | 44 | |
45 | - $filter = function ($element) { |
|
45 | + $filter = function($element) { |
|
46 | 46 | return $element instanceof ApplicationInterface |
47 | 47 | && $element->getPermissions()->hasChanged(); |
48 | 48 | }; |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | |
57 | 57 | foreach ($document->getAttachments() as $attachment) { /* @var \Applications\Entity\Attachment $attachment */ |
58 | 58 | $attachment->getPermissions() |
59 | - ->clear() |
|
60 | - ->inherit($permissions); |
|
59 | + ->clear() |
|
60 | + ->inherit($permissions); |
|
61 | 61 | if ($isUpdate) { |
62 | 62 | $uow->computeChangeSet( |
63 | 63 | $dm->getClassMetadata(get_class($attachment)), |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | |
69 | 69 | if ($image = $document->getContact()->getImage()) { |
70 | 70 | $image->getPermissions() |
71 | - ->clear() |
|
72 | - ->inherit($permissions); |
|
71 | + ->clear() |
|
72 | + ->inherit($permissions); |
|
73 | 73 | if ($isUpdate) { |
74 | 74 | $uow->computeChangeSet( |
75 | 75 | $dm->getClassMetadata(get_class($image)), |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | public function createService(ServiceLocatorInterface $serviceLocator) |
31 | 31 | { |
32 | - $auth = $serviceLocator->getServiceLocator()->get('AuthenticationService'); |
|
32 | + $auth = $serviceLocator->getServiceLocator()->get('AuthenticationService'); |
|
33 | 33 | $filter = new PaginationQuery($auth); |
34 | 34 | return $filter; |
35 | 35 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function findByUri($uri, $create = false) |
27 | 27 | { |
28 | - $subscriber = $this->findOneBy(array( "uri" => $uri )); |
|
28 | + $subscriber = $this->findOneBy(array("uri" => $uri)); |
|
29 | 29 | if (!isset($subscriber) && $create) { |
30 | 30 | $subscriber = $this->create(); |
31 | 31 | $subscriber->uri = $uri; |
@@ -97,9 +97,9 @@ |
||
97 | 97 | |
98 | 98 | $event = new AssertionEvent(null, $this); |
99 | 99 | $event->setAcl($acl) |
100 | - ->setRole($role) |
|
101 | - ->setResource($resource) |
|
102 | - ->setPrivilege($privilege); |
|
100 | + ->setRole($role) |
|
101 | + ->setResource($resource) |
|
102 | + ->setPrivilege($privilege); |
|
103 | 103 | |
104 | 104 | $events = $this->getEventManager(); |
105 | 105 |
@@ -105,7 +105,7 @@ |
||
105 | 105 | |
106 | 106 | $results = $events->trigger( |
107 | 107 | $event, |
108 | - function ($r) { |
|
108 | + function($r) { |
|
109 | 109 | return false === $r; |
110 | 110 | } |
111 | 111 | ); |