@@ -37,7 +37,7 @@ |
||
37 | 37 | /* @TODO: $jobRepository should be removed when using aggregation query in filtering profile */ |
38 | 38 | $authService = $container->get('AuthenticationService'); |
39 | 39 | $jobRepository = $container->get('Core/RepositoryService')->get('Jobs/Job'); |
40 | - $filter = new PaginationQuery($jobRepository,$authService); |
|
40 | + $filter = new PaginationQuery($jobRepository, $authService); |
|
41 | 41 | return $filter; |
42 | 42 | } |
43 | 43 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | $translator = $container->get('translator'); |
34 | 34 | $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager'); |
35 | 35 | $options = $container->get('Jobs/JobboardSearchOptions'); |
36 | - return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager,['count' => $options->getPerPage()]); |
|
36 | + return new ProfileController($repo, $jobRepository, $translator, $imageFileCacheManager, ['count' => $options->getPerPage()]); |
|
37 | 37 | } |
38 | 38 | } |
@@ -28,27 +28,27 @@ |
||
28 | 28 | */ |
29 | 29 | class FileController extends AbstractActionController |
30 | 30 | { |
31 | - /** |
|
32 | - * @var RepositoryService |
|
33 | - */ |
|
34 | - private $repositories; |
|
31 | + /** |
|
32 | + * @var RepositoryService |
|
33 | + */ |
|
34 | + private $repositories; |
|
35 | 35 | |
36 | - /** |
|
37 | - * @var EventManager |
|
38 | - */ |
|
39 | - private $coreFileEvents; |
|
36 | + /** |
|
37 | + * @var EventManager |
|
38 | + */ |
|
39 | + private $coreFileEvents; |
|
40 | 40 | |
41 | - public function __construct( |
|
42 | - RepositoryService $repositories, |
|
43 | - EventManager $eventManager |
|
44 | - ) |
|
45 | - { |
|
46 | - $this->repositories = $repositories; |
|
47 | - $this->coreFileEvents = $eventManager; |
|
48 | - } |
|
41 | + public function __construct( |
|
42 | + RepositoryService $repositories, |
|
43 | + EventManager $eventManager |
|
44 | + ) |
|
45 | + { |
|
46 | + $this->repositories = $repositories; |
|
47 | + $this->coreFileEvents = $eventManager; |
|
48 | + } |
|
49 | 49 | |
50 | 50 | |
51 | - protected function attachDefaultListeners() |
|
51 | + protected function attachDefaultListeners() |
|
52 | 52 | { |
53 | 53 | parent::attachDefaultListeners(); |
54 | 54 | $events = $this->getEventManager(); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $response = $this->getResponse(); |
74 | 74 | |
75 | 75 | try { |
76 | - $repository = $this->repositories->get($module . '/' . $entityName); |
|
76 | + $repository = $this->repositories->get($module.'/'.$entityName); |
|
77 | 77 | } catch (\Exception $e) { |
78 | 78 | $response->setStatusCode(404); |
79 | 79 | $this->getEvent()->setParam('exception', $e); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $this->acl($file); |
109 | 109 | |
110 | - $headers=$response->getHeaders(); |
|
110 | + $headers = $response->getHeaders(); |
|
111 | 111 | |
112 | 112 | $headers->addHeaderline('Content-Type', $file->getType()) |
113 | 113 | ->addHeaderline('Content-Length', $file->getLength()); |
@@ -26,6 +26,6 @@ |
||
26 | 26 | $repositories = $container->get('repositories'); |
27 | 27 | $coreFileEvents = $container->get('Core/File/Events'); |
28 | 28 | |
29 | - return new FileController($repositories,$coreFileEvents); |
|
29 | + return new FileController($repositories, $coreFileEvents); |
|
30 | 30 | } |
31 | 31 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $response->setStatusCode(Response::STATUS_CODE_404); |
42 | 42 | return $response; |
43 | 43 | } |
44 | - $jsonModel=new JsonModel(); |
|
44 | + $jsonModel = new JsonModel(); |
|
45 | 45 | $jsonModel->setVariables($this->apiJobDehydrator->dehydrateList($jobs)); |
46 | 46 | $jsonModel->setJsonpCallback($callback); |
47 | 47 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | ['name' => 'StringTrim'], |
41 | 41 | ['name' => 'Alpha'], |
42 | 42 | ], |
43 | - ]); |
|
43 | + ]); |
|
44 | 44 | |
45 | 45 | $controller = new ApiJobListByOrganizationController($jobRepository, $apiJobDehydrator, $inputFilter); |
46 | 46 |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | */ |
23 | 23 | protected $url; |
24 | 24 | |
25 | - /** |
|
26 | - * ViewHelper for generating an url to a job posting |
|
27 | - * |
|
28 | - * @var JobUrl $jobUrl |
|
29 | - */ |
|
25 | + /** |
|
26 | + * ViewHelper for generating an url to a job posting |
|
27 | + * |
|
28 | + * @var JobUrl $jobUrl |
|
29 | + */ |
|
30 | 30 | protected $jobUrl; |
31 | 31 | |
32 | 32 | /** |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | return $this; |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * @param JobUrl $url |
|
45 | - * |
|
46 | - * @return $this |
|
47 | - */ |
|
43 | + /** |
|
44 | + * @param JobUrl $url |
|
45 | + * |
|
46 | + * @return $this |
|
47 | + */ |
|
48 | 48 | public function setJobUrl($url) |
49 | 49 | { |
50 | 50 | $this->jobUrl = $url; |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | 'location' => $job->getLocation(), |
65 | 65 | 'link' => $this->jobUrl->__invoke( |
66 | 66 | $job,[ |
67 | - 'linkOnly'=> true, |
|
68 | - 'absolute' => true, |
|
67 | + 'linkOnly'=> true, |
|
68 | + 'absolute' => true, |
|
69 | 69 | ] |
70 | 70 | ), |
71 | 71 | 'organization' => array( |
@@ -63,7 +63,7 @@ |
||
63 | 63 | 'title' => $job->getTitle(), |
64 | 64 | 'location' => $job->getLocation(), |
65 | 65 | 'link' => $this->jobUrl->__invoke( |
66 | - $job,[ |
|
66 | + $job, [ |
|
67 | 67 | 'linkOnly'=> true, |
68 | 68 | 'absolute' => true, |
69 | 69 | ] |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
41 | - * @return mixed |
|
41 | + * @return \Auth\Entity\UserInterface |
|
42 | 42 | */ |
43 | 43 | public function getUser() |
44 | 44 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @param mixed $repositories |
|
71 | + * @param mixed $repository |
|
72 | 72 | * |
73 | 73 | * @return self |
74 | 74 | */ |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function getFileEntity() |
94 | 94 | { |
95 | - if (! $this->fileEntity instanceof FileInterface) { |
|
95 | + if (!$this->fileEntity instanceof FileInterface) { |
|
96 | 96 | throw new \RuntimeException('No file entity set or it does not implement \Core\Entity\FileInterface.'); |
97 | 97 | } |
98 | 98 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | |
102 | 102 | public function filter($value) |
103 | 103 | { |
104 | - if (! is_array($value) || ! isset($value['tmp_name']) || ((isset($value['error']) && UPLOAD_ERR_NO_FILE == $value['error']))) { |
|
104 | + if (!is_array($value) || !isset($value['tmp_name']) || ((isset($value['error']) && UPLOAD_ERR_NO_FILE == $value['error']))) { |
|
105 | 105 | return null; |
106 | 106 | } |
107 | 107 |
@@ -169,6 +169,9 @@ |
||
169 | 169 | return new ViewModel($result); |
170 | 170 | } |
171 | 171 | |
172 | + /** |
|
173 | + * @param Organization $organization |
|
174 | + */ |
|
172 | 175 | private function disabledProfileViewModel($organization) |
173 | 176 | { |
174 | 177 | $model = new ViewModel([ |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | |
84 | 84 | $result = $this->pagination([ |
85 | - 'params' => ['Organizations_Profile',[ |
|
85 | + 'params' => ['Organizations_Profile', [ |
|
86 | 86 | 'q', |
87 | 87 | 'count' => $this->options['count'], |
88 | 88 | 'page' => 1, |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $repo = $this->repo; |
117 | 117 | $id = $this->params('id'); |
118 | 118 | |
119 | - if(is_null($id)){ |
|
119 | + if (is_null($id)) { |
|
120 | 120 | $this->getResponse()->setStatusCode(Response::STATUS_CODE_404); |
121 | 121 | return [ |
122 | 122 | 'message' => $translator->translate('Can not access profile page without id'), |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | $organization = $repo->find($id); |
128 | - if(!$organization instanceof Organization){ |
|
128 | + if (!$organization instanceof Organization) { |
|
129 | 129 | throw new NotFoundException($id); |
130 | 130 | } |
131 | 131 | |
132 | - if( |
|
132 | + if ( |
|
133 | 133 | Organization::PROFILE_DISABLED == $organization->getProfileSetting() |
134 | 134 | || is_null($organization->getProfileSetting()) |
135 | - ){ |
|
135 | + ) { |
|
136 | 136 | return $this->disabledProfileViewModel($organization); |
137 | 137 | } |
138 | 138 | |
139 | 139 | $result = $this->pagination([ |
140 | 140 | 'params' => [ |
141 | - 'Organization_Jobs',[ |
|
141 | + 'Organization_Jobs', [ |
|
142 | 142 | 'q', |
143 | 143 | 'organization_id' => $id, |
144 | 144 | 'count' => $this->options['count'], |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | ], |
152 | 152 | ]); |
153 | 153 | |
154 | - if( |
|
154 | + if ( |
|
155 | 155 | Organization::PROFILE_ACTIVE_JOBS == $organization->getProfileSetting() |
156 | - ){ |
|
156 | + ) { |
|
157 | 157 | /* @var \Zend\Paginator\Paginator $paginator */ |
158 | 158 | $paginator = $result['jobs']; |
159 | 159 | $count = $paginator->getTotalItemCount(); |
160 | - if(0===$count){ |
|
160 | + if (0 === $count) { |
|
161 | 161 | return $this->disabledProfileViewModel($organization); |
162 | 162 | } |
163 | 163 | } |