@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @var String |
35 | 35 | */ |
36 | - protected $repositoryName="Organizations/Organization"; |
|
36 | + protected $repositoryName = "Organizations/Organization"; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Sortable fields |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | $auth = $this->authService; |
93 | 93 | $user = $auth->getUser(); |
94 | - $ignored = [null,'guest',UserInterface::ROLE_USER]; |
|
95 | - if(!in_array($user->getRole(),$ignored)){ |
|
94 | + $ignored = [null, 'guest', UserInterface::ROLE_USER]; |
|
95 | + if (!in_array($user->getRole(), $ignored)) { |
|
96 | 96 | $queryBuilder->field('permissions.view')->equals($user->getId()); |
97 | 97 | } |
98 | 98 | |
99 | - if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile' ) { |
|
99 | + if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile') { |
|
100 | 100 | $queryBuilder->text($params['q'])->language('none'); |
101 | 101 | } |
102 | 102 | |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | |
107 | 107 | $queryBuilder->sort($this->filterSort($value['sort'])); |
108 | 108 | |
109 | - if(isset($params['type']) && $params['type'] === 'profile'){ |
|
109 | + if (isset($params['type']) && $params['type'] === 'profile') { |
|
110 | 110 | //@TODO: we should use aggregate query here |
111 | 111 | $queryBuilder->field('profileSetting') |
112 | - ->in([Organization::PROFILE_ALWAYS_ENABLE,Organization::PROFILE_ACTIVE_JOBS]) |
|
112 | + ->in([Organization::PROFILE_ALWAYS_ENABLE, Organization::PROFILE_ACTIVE_JOBS]) |
|
113 | 113 | ; |
114 | 114 | |
115 | 115 | $filters = $this->getOrganizationProfileFilters($queryBuilder); |
116 | - if(count($filters) > 0){ |
|
116 | + if (count($filters) > 0) { |
|
117 | 117 | $queryBuilder->field('id')->notIn($filters); |
118 | 118 | } |
119 | 119 | |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | $results = $queryBuilder->getQuery()->execute(); |
134 | 134 | |
135 | 135 | $filters = []; |
136 | - foreach($results->toArray() as $organization){ |
|
137 | - if($organization->getProfileSetting()==Organization::PROFILE_ACTIVE_JOBS){ |
|
136 | + foreach ($results->toArray() as $organization) { |
|
137 | + if ($organization->getProfileSetting() == Organization::PROFILE_ACTIVE_JOBS) { |
|
138 | 138 | $qb = $jobRepository->createQueryBuilder(); |
139 | 139 | $qb |
140 | 140 | ->field('organization')->equals($organization->getId()) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ->field('isDraft')->notEqual(true) |
143 | 143 | ; |
144 | 144 | $count = $qb->getQuery()->execute()->count(); |
145 | - if($count == 0){ |
|
145 | + if ($count == 0) { |
|
146 | 146 | $filters[] = $organization->getId(); |
147 | 147 | } |
148 | 148 | } |
@@ -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 |