@@ -3,8 +3,8 @@ |
||
| 3 | 3 | |
| 4 | 4 | return array( |
| 5 | 5 | // This should be an array of module namespaces used in the application. |
| 6 | - 'modules' => array_merge($commonModules,array( |
|
| 7 | - 'Core', 'Auth', 'Jobs', 'Organizations', 'Applications', 'Cv', 'Settings' |
|
| 6 | + 'modules' => array_merge($commonModules, array( |
|
| 7 | + 'Core', 'Auth', 'Jobs', 'Organizations', 'Applications', 'Cv', 'Settings' |
|
| 8 | 8 | )), |
| 9 | 9 | |
| 10 | 10 | // These are various options for the listeners attached to the ModuleManager |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | |
| 153 | 153 | $contact->expects($this->exactly(2)) |
| 154 | 154 | ->method('setImage') |
| 155 | - ->withConsecutive([null],[$image]); |
|
| 155 | + ->withConsecutive([null], [$image]); |
|
| 156 | 156 | $result = $this->target->handleImageUpload('id', $info); |
| 157 | 157 | |
| 158 | 158 | $this->assertSame($app, $result); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | private $repository; |
| 45 | 45 | |
| 46 | - private $inheritance = [ Paginator::class ]; |
|
| 46 | + private $inheritance = [Paginator::class]; |
|
| 47 | 47 | |
| 48 | 48 | private function getTargetArgs() |
| 49 | 49 | { |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | ; |
| 70 | 70 | $qb->expects($this->once())->method('field')->with('title')->will($this->returnSelf()); |
| 71 | 71 | $qb->expects($this->once())->method('equals')->with( |
| 72 | - $this->callback(function ($value) use ($q) { |
|
| 73 | - if(!$value instanceof Regex){ |
|
| 72 | + $this->callback(function($value) use ($q) { |
|
| 73 | + if (!$value instanceof Regex) { |
|
| 74 | 74 | throw new \Exception("Value is not instance of regex"); |
| 75 | 75 | } |
| 76 | - return $value instanceof Regex && (string) $value->getPattern() == '/' . $q . '/i'; |
|
| 76 | + return $value instanceof Regex && (string) $value->getPattern() == '/'.$q.'/i'; |
|
| 77 | 77 | }) |
| 78 | 78 | ); |
| 79 | 79 | $this->repository |
@@ -46,11 +46,11 @@ discard block |
||
| 46 | 46 | ], |
| 47 | 47 | ]; |
| 48 | 48 | |
| 49 | - private $inheritance = [ AbstractPaginationQuery::class ]; |
|
| 49 | + private $inheritance = [AbstractPaginationQuery::class]; |
|
| 50 | 50 | |
| 51 | 51 | private $attributes = [ |
| 52 | 52 | 'repositoryName' => 'Applications/Application', |
| 53 | - 'sortPropertiesMap' => [ 'date' => 'dateCreated.date' ] |
|
| 53 | + 'sortPropertiesMap' => ['date' => 'dateCreated.date'] |
|
| 54 | 54 | ]; |
| 55 | 55 | |
| 56 | 56 | private $authMock; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | private function getTargetArgs() |
| 59 | 59 | { |
| 60 | 60 | $this->authMock = $this->getMockBuilder(AuthenticationService::class)->disableOriginalConstructor()->getMock(); |
| 61 | - return [ $this->authMock ]; |
|
| 61 | + return [$this->authMock]; |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | private function getTargetArgsForCreateQueryTest() |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $auth = $this |
| 70 | 70 | ->getMockBuilder(AuthenticationService::class) |
| 71 | 71 | ->disableOriginalConstructor() |
| 72 | - ->setMethods(['getUser' ]) |
|
| 72 | + ->setMethods(['getUser']) |
|
| 73 | 73 | ->getMock() |
| 74 | 74 | ; |
| 75 | 75 | |
@@ -121,8 +121,8 @@ discard block |
||
| 121 | 121 | $qb1->expects($this->exactly(2))->method('sort')->with(['dateCreated.date' => -1])->will($this->returnSelf()); |
| 122 | 122 | |
| 123 | 123 | $qb2->expects($this->exactly(6))->method('field')->withConsecutive( |
| 124 | - [ 'job'], |
|
| 125 | - [ 'readBy'], |
|
| 124 | + ['job'], |
|
| 125 | + ['readBy'], |
|
| 126 | 126 | ['keywords'], |
| 127 | 127 | ['permissions.view'], |
| 128 | 128 | ['isDraft'], |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | [$params3['status']] |
| 136 | 136 | )->will($this->returnSelf()); |
| 137 | 137 | $qb2->expects($this->once())->method('notEqual')->with('PqtUser'); |
| 138 | - $qb2->expects($this->once())->method('all')->with($this->callback(function ($arg) { |
|
| 138 | + $qb2->expects($this->once())->method('all')->with($this->callback(function($arg) { |
|
| 139 | 139 | return is_array($arg) && $arg[0] instanceof Regex; |
| 140 | 140 | })); |
| 141 | 141 | $qb2->expects($this->once())->method('sort')->with(['testSort' => 1]); |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | { |
| 154 | 154 | public function __call($method, $args) |
| 155 | 155 | { |
| 156 | - $this->callstack[] = [ $method, $args ]; |
|
| 156 | + $this->callstack[] = [$method, $args]; |
|
| 157 | 157 | |
| 158 | 158 | return $this; |
| 159 | 159 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $qb = $this->repository->getUserApplications($user->getId()); |
| 55 | 55 | $qb->count(); |
| 56 | 56 | $result = $qb->getQuery()->getSingleResult(); |
| 57 | - return (int)$result; |
|
| 57 | + return (int) $result; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | foreach ($iterator->toArray() as $application) |
| 70 | 70 | { |
| 71 | 71 | $title = $application->getJob()->getTitle(); |
| 72 | - $title .= ' ('. $view->dateFormat($application->getDateCreated()) . ')'; |
|
| 72 | + $title .= ' ('.$view->dateFormat($application->getDateCreated()).')'; |
|
| 73 | 73 | $url = $view->url('lang/applications/detail', ['id' => $application->getId()]); |
| 74 | 74 | $items[] = new ListItem($title, $url); |
| 75 | 75 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if ($entity instanceof Job) { |
| 30 | 30 | $entities = $event->getRepository('Applications')->findBy(['isDraft' => null, 'job' => new ObjectId($entity->getId())]); |
| 31 | 31 | |
| 32 | - return ['Applications', $entities, 'These applications references the job and will also be removed:' ]; |
|
| 32 | + return ['Applications', $entities, 'These applications references the job and will also be removed:']; |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | foreach ($entities as $ent) { |
| 44 | 44 | $repository->remove($ent); |
| 45 | 45 | } |
| 46 | - return ['Applications', $entities, 'were removed.' ]; |
|
| 46 | + return ['Applications', $entities, 'were removed.']; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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( |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | { |
| 53 | 53 | /* @var \Doctrine\ODM\MongoDB\Query\Builder $qb */ |
| 54 | 54 | $qb = $this->repository->createQueryBuilder(); |
| 55 | - $qb->field('title')->equals(new Regex('/' . addslashes($q) . '/i')); |
|
| 55 | + $qb->field('title')->equals(new Regex('/'.addslashes($q).'/i')); |
|
| 56 | 56 | |
| 57 | 57 | $adapter = new DoctrineMongoAdapter($qb); |
| 58 | 58 | parent::__construct($adapter); |
@@ -32,6 +32,6 @@ |
||
| 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 | } |