@@ -22,7 +22,7 @@ |
||
22 | 22 | * Creates an instance of MailForgotPassword |
23 | 23 | * |
24 | 24 | * @param ServiceLocatorInterface $serviceLocator |
25 | - * @return \Auth\View\Helper\Auth |
|
25 | + * @return MailForgotPassword |
|
26 | 26 | * @see \Zend\ServiceManager\FactoryInterface::createService() |
27 | 27 | */ |
28 | 28 | public function createService(ServiceLocatorInterface $serviceLocator) |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param Params $params |
56 | 56 | * @param bool $allowDraft |
57 | 57 | * |
58 | - * @return object|\Organizations\Entity\Organization |
|
58 | + * @return \Organizations\Entity\OrganizationInterface |
|
59 | 59 | * @throws UnauthorizedAccessException |
60 | 60 | * @throws \Doctrine\ODM\MongoDB\LockException |
61 | 61 | */ |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected $acl; |
42 | 42 | |
43 | - public function __construct(RepositoryService $repositoryService,AuthenticationService $auth, Acl $acl) { |
|
44 | - $this->repositoryService=$repositoryService; |
|
45 | - $this->auth=$auth; |
|
46 | - $this->acl=$acl; |
|
43 | + public function __construct(RepositoryService $repositoryService, AuthenticationService $auth, Acl $acl) { |
|
44 | + $this->repositoryService = $repositoryService; |
|
45 | + $this->auth = $auth; |
|
46 | + $this->acl = $acl; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function __invoke() |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @throws UnauthorizedAccessException |
60 | 60 | * @throws \Doctrine\ODM\MongoDB\LockException |
61 | 61 | */ |
62 | - public function process(Params $params,$allowDraft = true) |
|
62 | + public function process(Params $params, $allowDraft = true) |
|
63 | 63 | { |
64 | - $repositories = $this->repositoryService; |
|
64 | + $repositories = $this->repositoryService; |
|
65 | 65 | /* @var \Organizations\Repository\Organization $organizationRepository */ |
66 | 66 | $organizationRepository = $this->repositoryService->get('Organizations/Organization'); |
67 | 67 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $user = $this->auth->getUser(); /* @var $user \Auth\Entity\UserInterface */ |
71 | 71 | |
72 | 72 | /* @var $organizationId string */ |
73 | - $organizationId = empty($idFromRoute)?$idFromSubForm:$idFromRoute; |
|
73 | + $organizationId = empty($idFromRoute) ? $idFromSubForm : $idFromRoute; |
|
74 | 74 | |
75 | 75 | $editOwnOrganization = '__my__' === $organizationId; |
76 | 76 | |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | return $organization; |
106 | 106 | } |
107 | 107 | |
108 | - $organization = $organizationRepository->find($organizationId); |
|
108 | + $organization = $organizationRepository->find($organizationId); |
|
109 | 109 | if (!$organization) { |
110 | - throw new \RuntimeException('No Organization found with id "' . $organizationId . '"'); |
|
110 | + throw new \RuntimeException('No Organization found with id "'.$organizationId.'"'); |
|
111 | 111 | } |
112 | 112 | return $organization; |
113 | 113 | } |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * @param string $par Query Parameter |
19 | 19 | * @param string $geoCoderUrl Url of the geo location service |
20 | - * @param string $land language |
|
20 | + * @param string $lang language |
|
21 | 21 | * |
22 | 22 | * @return array|mixed|string |
23 | 23 | */ |
@@ -51,16 +51,16 @@ |
||
51 | 51 | $r=[]; |
52 | 52 | foreach ($result as $key => $val) { |
53 | 53 | $row=['name' => (property_exists($val->properties, 'name') ? $val->properties->name:''), |
54 | - 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode:''), |
|
55 | - 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city:''), |
|
56 | - 'street' => (property_exists($val->properties, 'street') ? $val->properties->street : ''), |
|
57 | - 'state' => (property_exists($val->properties, 'state') ? $val->properties->state : ''), |
|
58 | - 'country' => (property_exists($val->properties, 'country') ? $val->properties->country : ''), |
|
59 | - 'coordinates' => implode(":", $val->geometry->coordinates), |
|
60 | - 'osm_key' => (property_exists($val->properties, 'osm_key') ? $val->properties->osm_key : ''), |
|
61 | - 'osm_value' => (property_exists($val->properties, 'osm_value') ? $val->properties->osm_value : ''), |
|
62 | - 'osm_id' => (property_exists($val->properties, 'osm_id') ? $val->properties->osm_id : ''), |
|
63 | - 'data' => json_encode($val), |
|
54 | + 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode:''), |
|
55 | + 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city:''), |
|
56 | + 'street' => (property_exists($val->properties, 'street') ? $val->properties->street : ''), |
|
57 | + 'state' => (property_exists($val->properties, 'state') ? $val->properties->state : ''), |
|
58 | + 'country' => (property_exists($val->properties, 'country') ? $val->properties->country : ''), |
|
59 | + 'coordinates' => implode(":", $val->geometry->coordinates), |
|
60 | + 'osm_key' => (property_exists($val->properties, 'osm_key') ? $val->properties->osm_key : ''), |
|
61 | + 'osm_value' => (property_exists($val->properties, 'osm_value') ? $val->properties->osm_value : ''), |
|
62 | + 'osm_id' => (property_exists($val->properties, 'osm_id') ? $val->properties->osm_id : ''), |
|
63 | + 'data' => json_encode($val), |
|
64 | 64 | ]; |
65 | 65 | $r[]=$row; |
66 | 66 | } |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | $client->setMethod('GET'); |
28 | 28 | |
29 | 29 | $osmTags = [ |
30 | - 'tourism','aeroway','railway', 'amenity', 'historic', 'tunnel', 'mountain_pass', |
|
30 | + 'tourism', 'aeroway', 'railway', 'amenity', 'historic', 'tunnel', 'mountain_pass', |
|
31 | 31 | 'leisure', 'natural', 'bridge', 'waterway' |
32 | 32 | ]; |
33 | 33 | |
34 | - $osmTags = array_map(function($i) { return urlencode('!' . $i); }, $osmTags); |
|
34 | + $osmTags = array_map(function($i) { return urlencode('!'.$i); }, $osmTags); |
|
35 | 35 | |
36 | 36 | $uri = sprintf( |
37 | 37 | '%s?q=%s&lang=%s&osm_tag=%s', |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | $result = $response->getBody(); |
49 | 49 | $result = json_decode($result); |
50 | 50 | $result = $result->features; |
51 | - $r=[]; |
|
51 | + $r = []; |
|
52 | 52 | foreach ($result as $key => $val) { |
53 | - $row=['name' => (property_exists($val->properties, 'name') ? $val->properties->name:''), |
|
54 | - 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode:''), |
|
55 | - 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city:''), |
|
53 | + $row = ['name' => (property_exists($val->properties, 'name') ? $val->properties->name : ''), |
|
54 | + 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode : ''), |
|
55 | + 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city : ''), |
|
56 | 56 | 'street' => (property_exists($val->properties, 'street') ? $val->properties->street : ''), |
57 | 57 | 'state' => (property_exists($val->properties, 'state') ? $val->properties->state : ''), |
58 | 58 | 'country' => (property_exists($val->properties, 'country') ? $val->properties->country : ''), |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'osm_id' => (property_exists($val->properties, 'osm_id') ? $val->properties->osm_id : ''), |
63 | 63 | 'data' => json_encode($val), |
64 | 64 | ]; |
65 | - $r[]=$row; |
|
65 | + $r[] = $row; |
|
66 | 66 | } |
67 | 67 | return $r; |
68 | 68 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | /** |
21 | 21 | * @param ServiceLocatorInterface $serviceLocator |
22 | - * @return PaginationAdminQuery|mixed |
|
22 | + * @return PaginationAdminQuery |
|
23 | 23 | */ |
24 | 24 | public function createService(ServiceLocatorInterface $serviceLocator) |
25 | 25 | { |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | /** |
16 | 16 | * @param ServiceLocatorInterface $serviceLocator |
17 | - * @return PaginationQuery|mixed |
|
17 | + * @return PaginationQuery |
|
18 | 18 | */ |
19 | 19 | public function createService(ServiceLocatorInterface $serviceLocator) |
20 | 20 | { |
@@ -81,12 +81,12 @@ discard block |
||
81 | 81 | $url = $router->assemble( |
82 | 82 | array('action' => 'accept'), |
83 | 83 | array( |
84 | - 'name' => 'lang/organizations/invite', |
|
85 | - 'query' => array( |
|
86 | - 'token' => $this->options['token'], |
|
87 | - 'organization' => $org->getId() |
|
88 | - ) |
|
89 | - ) |
|
84 | + 'name' => 'lang/organizations/invite', |
|
85 | + 'query' => array( |
|
86 | + 'token' => $this->options['token'], |
|
87 | + 'organization' => $org->getId() |
|
88 | + ) |
|
89 | + ) |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | $variables = array( |
@@ -107,14 +107,14 @@ discard block |
||
107 | 107 | |
108 | 108 | $mail = $serviceLocator->get('htmltemplate'); |
109 | 109 | $mail->setTemplate($this->options['template']) |
110 | - ->setVariables($variables) |
|
111 | - ->setSubject( |
|
112 | - sprintf( |
|
113 | - /* @translate */ 'Invitation to join the team of %s', |
|
114 | - $orgName |
|
115 | - ) |
|
116 | - ) |
|
117 | - ->addTo($user->getEmail()); |
|
110 | + ->setVariables($variables) |
|
111 | + ->setSubject( |
|
112 | + sprintf( |
|
113 | + /* @translate */ 'Invitation to join the team of %s', |
|
114 | + $orgName |
|
115 | + ) |
|
116 | + ) |
|
117 | + ->addTo($user->getEmail()); |
|
118 | 118 | |
119 | 119 | return $mail; |
120 | 120 | } |
@@ -108,6 +108,9 @@ |
||
108 | 108 | return parent::setSubject($subject); |
109 | 109 | } |
110 | 110 | |
111 | + /** |
|
112 | + * @param string $formatString |
|
113 | + */ |
|
111 | 114 | public function setFormattedSubject($formatString) |
112 | 115 | { |
113 | 116 | $args = func_get_args(); |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @param array $defaultParams |
31 | 31 | * @param bool $usePostParams |
32 | 32 | * |
33 | - * @return mixed |
|
33 | + * @return ZendPaginator |
|
34 | 34 | */ |
35 | 35 | public function __invoke($paginatorName, $defaultParams = array(), $usePostParams = false) |
36 | 36 | { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | $this->filterSortParam($params); |
43 | 43 | $paginator = $this->createPaginator($repository, $params); |
44 | 44 | $paginator->setCurrentPageNumber($params->get('page', 1)) |
45 | - ->setItemCountPerPage($params->get('count', 10)); |
|
45 | + ->setItemCountPerPage($params->get('count', 10)); |
|
46 | 46 | |
47 | 47 | return $paginator; |
48 | 48 |
@@ -61,11 +61,11 @@ |
||
61 | 61 | $paginatorManager = $this->serviceManager->get('Core/PaginatorService'); |
62 | 62 | $paginator = $paginatorManager->get($paginatorName); |
63 | 63 | if (!isset($paginator) || !$paginator instanceof ZendPaginator) { |
64 | - throw new \RuntimeException('Could not create paginator ' . $paginatorName); |
|
64 | + throw new \RuntimeException('Could not create paginator '.$paginatorName); |
|
65 | 65 | } |
66 | 66 | $adapter = $paginator->getAdapter(); |
67 | 67 | if (!isset($adapter) || !$adapter instanceof AdapterInterface) { |
68 | - throw new \RuntimeException('Paginator ' . $paginatorName . ' has no Adapter'); |
|
68 | + throw new \RuntimeException('Paginator '.$paginatorName.' has no Adapter'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $params = $usePostParams |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | $location = new Location(); |
180 | 180 | $coords = array_map(function($i) { return (float) $i; }, $locData['coordinates']); |
181 | 181 | $location->setCountry($locData['country']) |
182 | - ->setRegion($locData['region']) |
|
183 | - ->setCity($locData['city']) |
|
184 | - ->setCoordinates(new Point($coords)); |
|
182 | + ->setRegion($locData['region']) |
|
183 | + ->setCity($locData['city']) |
|
184 | + ->setCoordinates(new Point($coords)); |
|
185 | 185 | |
186 | 186 | $jobLocations->add($location); |
187 | 187 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | /* @var $jobEvents \Zend\EventManager\EventManager */ |
213 | 213 | $jobEvents = $services->get('Jobs/Events'); |
214 | 214 | $jobEvent->setName(JobEvent::EVENT_JOB_ACCEPTED) |
215 | - ->setTarget($this); |
|
215 | + ->setTarget($this); |
|
216 | 216 | $responses = $jobEvents->trigger($jobEvent); |
217 | 217 | foreach ($responses as $response) { |
218 | 218 | // responses from the portals |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $entity = $repositoriesJob->findOneBy(array("applyId" => (string) $applyId)); |
83 | 83 | if (!isset($entity)) { |
84 | 84 | // new Job (the more likely branch) |
85 | - $entity =$repositoriesJob->create(array("applyId" => (string) $applyId)); |
|
85 | + $entity = $repositoriesJob->create(array("applyId" => (string) $applyId)); |
|
86 | 86 | } else { |
87 | 87 | $createdJob = false; |
88 | 88 | } |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $entity->getPermissions()->grant($group, PermissionsInterface::PERMISSION_VIEW); |
126 | 126 | } |
127 | 127 | $result['isSaved'] = true; |
128 | - $log->info('Jobs/manage/saveJob [user: ' . $user->login . ']:' . var_export($p, true)); |
|
128 | + $log->info('Jobs/manage/saveJob [user: '.$user->login.']:'.var_export($p, true)); |
|
129 | 129 | |
130 | 130 | if (!empty($params->companyId)) { |
131 | - $companyId = $params->companyId . $loginSuffix; |
|
131 | + $companyId = $params->companyId.$loginSuffix; |
|
132 | 132 | $repOrganization = $repositories->get('Organizations/Organization'); |
133 | 133 | $hydratorManager = $services->get('hydratorManager'); |
134 | 134 | /* @var \Organizations\Entity\Hydrator\OrganizationHydrator $hydrator */ |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $jobLocations->clear(); |
180 | 180 | foreach ($locations as $locData) { |
181 | 181 | $location = new Location(); |
182 | - $coords = array_map(function ($i) { return (float) $i; }, $locData['coordinates']); |
|
182 | + $coords = array_map(function($i) { return (float) $i; }, $locData['coordinates']); |
|
183 | 183 | $location->setCountry($locData['country']) |
184 | 184 | ->setRegion($locData['region']) |
185 | 185 | ->setCity($locData['city']) |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | break; |
245 | 245 | } |
246 | 246 | if (array_key_exists($portal, $result['portals'])) { |
247 | - throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for ' . $portal); |
|
247 | + throw new \RuntimeException('Publisher-Events (internal error): There are two publisher registered for '.$portal); |
|
248 | 248 | } |
249 | 249 | $result['portals'][$portal] = $status; |
250 | 250 | } else { |
@@ -257,16 +257,16 @@ discard block |
||
257 | 257 | } |
258 | 258 | } |
259 | 259 | } else { |
260 | - $log->info('Jobs/manage/saveJob [error: ' . $form->getMessages() . ']:' . var_export($p, true)); |
|
260 | + $log->info('Jobs/manage/saveJob [error: '.$form->getMessages().']:'.var_export($p, true)); |
|
261 | 261 | $result['valid Error'] = $form->getMessages(); |
262 | 262 | } |
263 | 263 | } |
264 | 264 | } else { |
265 | - $log->info('Jobs/manage/saveJob [error: session lost]:' . var_export($p, true)); |
|
265 | + $log->info('Jobs/manage/saveJob [error: session lost]:'.var_export($p, true)); |
|
266 | 266 | $result['message'] = 'session_id is lost'; |
267 | 267 | } |
268 | 268 | } catch (\Exception $e) { |
269 | - $result['message'] = 'exception occured: ' . $e->getMessage(); |
|
269 | + $result['message'] = 'exception occured: '.$e->getMessage(); |
|
270 | 270 | } |
271 | 271 | //$services->get('Core/Log')->info('Jobs/manage/saveJob result:' . PHP_EOL . var_export($p, True)); |
272 | 272 | return new JsonModel($result); |