@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $response = $this->client->send(); |
71 | 71 | if ($response->getStatusCode() !== 200) { |
72 | - throw new \RuntimeException('Query failed, because ' . $response->getReasonPhrase()); |
|
72 | + throw new \RuntimeException('Query failed, because '.$response->getReasonPhrase()); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | $result = $response->getBody(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | $result = json_decode($result, JSON_OBJECT_AS_ARRAY); |
42 | 42 | |
43 | - $r=[]; |
|
43 | + $r = []; |
|
44 | 44 | foreach ($result["result"] as $val) { |
45 | 45 | $coords = $this->queryCoords($val); |
46 | 46 | if (false !== strpos($val, ',')) { |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | 'state' => $state, |
58 | 58 | 'coordinates' => $coords, |
59 | 59 | 'id' => $coords |
60 | - ? 'c:' . $coords[0] . ':' . $coords[1] |
|
61 | - : 'q:' . $val, |
|
60 | + ? 'c:'.$coords[0].':'.$coords[1] |
|
61 | + : 'q:'.$val, |
|
62 | 62 | 'data' => json_encode($val), |
63 | 63 | ]; |
64 | 64 | } |
@@ -78,6 +78,6 @@ discard block |
||
78 | 78 | $coord = $result["result"][0]; |
79 | 79 | $coord = explode(',', $coord); |
80 | 80 | |
81 | - return [str_replace('.', ',', $coord[1]), str_replace('.',',',$coord[0])]; |
|
81 | + return [str_replace('.', ',', $coord[1]), str_replace('.', ',', $coord[0])]; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | \ No newline at end of file |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | $client->setMethod('GET'); |
29 | 29 | |
30 | 30 | $osmTags = [ |
31 | - 'tourism','aeroway','railway', 'amenity', 'historic', 'tunnel', 'mountain_pass', |
|
31 | + 'tourism', 'aeroway', 'railway', 'amenity', 'historic', 'tunnel', 'mountain_pass', |
|
32 | 32 | 'leisure', 'natural', 'bridge', 'waterway' |
33 | 33 | ]; |
34 | 34 | |
35 | - $osmTags = array_map(function($i) { return urlencode('!' . $i); }, $osmTags); |
|
35 | + $osmTags = array_map(function($i) { return urlencode('!'.$i); }, $osmTags); |
|
36 | 36 | |
37 | 37 | $uri = sprintf( |
38 | 38 | '%s?osm_tag=%s', |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | { |
60 | 60 | $result = json_decode($result); |
61 | 61 | $result = $result->features; |
62 | - $r=[]; |
|
62 | + $r = []; |
|
63 | 63 | foreach ($result as $key => $val) { |
64 | - $row=['name' => (property_exists($val->properties, 'name') ? $val->properties->name:''), |
|
65 | - 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode:''), |
|
66 | - 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city:''), |
|
64 | + $row = ['name' => (property_exists($val->properties, 'name') ? $val->properties->name : ''), |
|
65 | + 'postcode' => (property_exists($val->properties, 'postcode') ? $val->properties->postcode : ''), |
|
66 | + 'city' =>(property_exists($val->properties, 'city') ? $val->properties->city : ''), |
|
67 | 67 | 'street' => (property_exists($val->properties, 'street') ? $val->properties->street : ''), |
68 | 68 | 'state' => (property_exists($val->properties, 'state') ? $val->properties->state : ''), |
69 | 69 | 'country' => (property_exists($val->properties, 'country') ? $val->properties->country : ''), |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | //'id' => (property_exists($val->properties, 'osm_id') ? $val->properties->osm_id : uniqid()), |
74 | 74 | 'data' => json_encode($val), |
75 | 75 | ]; |
76 | - $row['id'] = 'c:' . (float) $row['coordinates'][0] . ':' . (float) $row['coordinates'][1]; |
|
77 | - $r[]=$row; |
|
76 | + $row['id'] = 'c:'.(float) $row['coordinates'][0].':'.(float) $row['coordinates'][1]; |
|
77 | + $r[] = $row; |
|
78 | 78 | } |
79 | 79 | return $r; |
80 | 80 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $select = new GeoSelect(); |
33 | 33 | |
34 | 34 | //$select->setAttribute('data-type', $geoOptions->getPlugin()); |
35 | - $select->setAttribute('data-uri', 'geo/' . $geoOptions->getPlugin()); |
|
35 | + $select->setAttribute('data-uri', 'geo/'.$geoOptions->getPlugin()); |
|
36 | 36 | |
37 | 37 | return $select; |
38 | 38 | } |
@@ -96,18 +96,18 @@ discard block |
||
96 | 96 | $replyTo = $this->stringFromMailHeader($this->getReplyTo()); |
97 | 97 | |
98 | 98 | return str_pad($template, 30) |
99 | - . 'to: ' . str_pad($to, 50) |
|
100 | - . 'cc: ' . str_pad($cc, 50) |
|
101 | - . 'bcc: ' . str_pad($bcc, 50) |
|
102 | - . 'from: ' . str_pad($from, 50) |
|
103 | - . 'replyTo: ' . str_pad($replyTo, 50) |
|
99 | + . 'to: '.str_pad($to, 50) |
|
100 | + . 'cc: '.str_pad($cc, 50) |
|
101 | + . 'bcc: '.str_pad($bcc, 50) |
|
102 | + . 'from: '.str_pad($from, 50) |
|
103 | + . 'replyTo: '.str_pad($replyTo, 50) |
|
104 | 104 | //. str_pad(implode(',', ArrayUtils::iteratorToArray($this->getSender())),50) |
105 | - . 'subject: ' . str_pad($this->getSubject(), 50); |
|
105 | + . 'subject: '.str_pad($this->getSubject(), 50); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | public function template($template) |
109 | 109 | { |
110 | - $controller = get_class($this->controller); |
|
110 | + $controller = get_class($this->controller); |
|
111 | 111 | $services = $this->serviceManager; |
112 | 112 | |
113 | 113 | $event = new Event(); |
@@ -124,11 +124,11 @@ discard block |
||
124 | 124 | $controllerIdentifier = strtolower(substr($controller, 0, strpos($controller, '\\'))); |
125 | 125 | $viewResolver = $this->serviceManager->get('ViewResolver'); |
126 | 126 | |
127 | - $templateHalf = 'mail/' . $template; |
|
127 | + $templateHalf = 'mail/'.$template; |
|
128 | 128 | $resource = $viewResolver->resolve($templateHalf); |
129 | 129 | |
130 | 130 | if (empty($resource)) { |
131 | - $templateFull = $controllerIdentifier . '/mail/' . $template; |
|
131 | + $templateFull = $controllerIdentifier.'/mail/'.$template; |
|
132 | 132 | $resource = $viewResolver->resolve($templateFull); |
133 | 133 | } |
134 | 134 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | unset($__vars[$key]); |
156 | 156 | } |
157 | 157 | } |
158 | - unset($__vars['content'],$__vars['controllerIdentifier'],$__vars['controller'],$__vars['resource'],$__vars['template'],$__vars['viewResolver']); |
|
158 | + unset($__vars['content'], $__vars['controllerIdentifier'], $__vars['controller'], $__vars['resource'], $__vars['template'], $__vars['viewResolver']); |
|
159 | 159 | $this->config = $__vars; |
160 | 160 | } |
161 | 161 | } |
@@ -180,20 +180,20 @@ discard block |
||
180 | 180 | if (isset($this->config['from'])) { |
181 | 181 | $from = $this->config['from']; |
182 | 182 | } else { |
183 | - $log->err('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
184 | - throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
183 | + $log->err('A from email address must be provided (Variable $from) in Template: '.$template); |
|
184 | + throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: '.$template); |
|
185 | 185 | } |
186 | 186 | if (isset($this->config['fromName'])) { |
187 | 187 | $fromName = $this->config['fromName']; |
188 | 188 | } else { |
189 | - $log->err('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
190 | - throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
189 | + $log->err('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
190 | + throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
191 | 191 | } |
192 | 192 | if (isset($this->config['subject'])) { |
193 | 193 | $subject = $this->config['subject']; |
194 | 194 | } else { |
195 | - $log->err('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
196 | - throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
195 | + $log->err('A subject must be provided (Variable $subject) in Template: '.$template); |
|
196 | + throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: '.$template); |
|
197 | 197 | } |
198 | 198 | $this->setFrom($from, $fromName); |
199 | 199 | $this->setSubject($subject); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $erg = true; |
216 | 216 | $log->info($this); |
217 | 217 | } catch (\Exception $e) { |
218 | - $log->err('Mail failure ' . $e->getMessage()); |
|
218 | + $log->err('Mail failure '.$e->getMessage()); |
|
219 | 219 | //$this->serviceManager->get('Core/Log')->warn('Mail failure ' . $e->getMessage()); |
220 | 220 | } |
221 | 221 | //} |
@@ -61,7 +61,7 @@ |
||
61 | 61 | * |
62 | 62 | * @return self |
63 | 63 | */ |
64 | - public function addViewModel($name, $model, $priority=0) |
|
64 | + public function addViewModel($name, $model, $priority = 0) |
|
65 | 65 | { |
66 | 66 | $this->models->insert($name, $model, $priority); |
67 | 67 |
@@ -130,7 +130,7 @@ |
||
130 | 130 | |
131 | 131 | protected function checkEntityType($entity) |
132 | 132 | { |
133 | - if ( !($entity instanceOf $this->entityPrototype) ) { |
|
133 | + if (!($entity instanceOf $this->entityPrototype)) { |
|
134 | 134 | throw new \InvalidArgumentException(sprintf( |
135 | 135 | 'Entity must be of type %s but recieved %s instead', |
136 | 136 | get_class($this->entityPrototype), |
@@ -40,12 +40,12 @@ |
||
40 | 40 | */ |
41 | 41 | public function attachShared(SharedEventManagerInterface $events) |
42 | 42 | { |
43 | - $events->attach('*', NotificationEvent::EVENT_NOTIFICATION_ADD, array($this,'add'), 1); |
|
44 | - $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, array($this,'renderJSON'), -240); |
|
45 | - $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, array($this,'renderHTML'), -250); |
|
43 | + $events->attach('*', NotificationEvent::EVENT_NOTIFICATION_ADD, array($this, 'add'), 1); |
|
44 | + $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, array($this, 'renderJSON'), -240); |
|
45 | + $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_DISPATCH, array($this, 'renderHTML'), -250); |
|
46 | 46 | // Sometimes the Dispatch-Event is not reached, for instance with a route-direct |
47 | 47 | // but also for Events, that are happening after the Dispatch |
48 | - $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_FINISH, array($this,'renderHTML'), -250); |
|
48 | + $events->attach('Zend\Mvc\Application', MvcEvent::EVENT_FINISH, array($this, 'renderHTML'), -250); |
|
49 | 49 | return $this; |
50 | 50 | } |
51 | 51 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $renderer->headscript()->appendFile($renderer->basePath('Core/js/jquery.summary-form.js')); |
68 | 68 | |
69 | 69 | $label = $form->getLabel(); |
70 | - $labelContent = $label ? '<div class="sf-headline"><h3>' . $this->getView()->translate($label) . '</h3></div>' : ''; |
|
70 | + $labelContent = $label ? '<div class="sf-headline"><h3>'.$this->getView()->translate($label).'</h3></div>' : ''; |
|
71 | 71 | $formContent = $this->renderForm($form, $layout, $parameter); |
72 | 72 | $summaryContent = $this->renderSummary($form); |
73 | 73 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | public function renderForm(SummaryFormInterface $form, $layout = Form::LAYOUT_HORIZONTAL, $parameter = array()) |
132 | 132 | { |
133 | 133 | /* @var $form SummaryFormInterface|\Core\Form\SummaryForm */ |
134 | - $renderer = $this->getView(); /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
|
135 | - $formHelper = $renderer->plugin('form'); /* @var $formHelper \Core\Form\View\Helper\Form */ |
|
134 | + $renderer = $this->getView(); /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
|
135 | + $formHelper = $renderer->plugin('form'); /* @var $formHelper \Core\Form\View\Helper\Form */ |
|
136 | 136 | $fieldset = $form->getBaseFieldset(); |
137 | 137 | $resetPartial = false; |
138 | 138 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $form->prepare(); |
167 | 167 | $baseFieldset = $form->getBaseFieldset(); |
168 | 168 | if (!isset($baseFieldset)) { |
169 | - throw new \InvalidArgumentException('For the Form ' . get_class($form) . ' there is no Basefieldset'); |
|
169 | + throw new \InvalidArgumentException('For the Form '.get_class($form).' there is no Basefieldset'); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | $dataAttributesMarkup = ''; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | |
182 | - $markup = '<div class="panel panel-default" style="min-height: 100px;"' . $dataAttributesMarkup . '> |
|
182 | + $markup = '<div class="panel panel-default" style="min-height: 100px;"'.$dataAttributesMarkup.'> |
|
183 | 183 | <div class="panel-body"><div class="sf-controls">%s</div>%s</div></div>'; |
184 | 184 | |
185 | 185 | $view = $this->getView(); |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | |
193 | 193 | if (($controlButtons = $form->getOption('control_buttons')) !== null) |
194 | 194 | { |
195 | - $buttonMarkup .= PHP_EOL . implode(PHP_EOL, array_map(function (array $buttonSpec) use ($view) { |
|
196 | - return '<button type="button" class="btn btn-default btn-xs' . (isset($buttonSpec['class']) ? ' ' . $buttonSpec['class'] : '') . '">' |
|
197 | - . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-' . $buttonSpec['icon'] . '"></span> ' : '') |
|
195 | + $buttonMarkup .= PHP_EOL.implode(PHP_EOL, array_map(function(array $buttonSpec) use ($view) { |
|
196 | + return '<button type="button" class="btn btn-default btn-xs'.(isset($buttonSpec['class']) ? ' '.$buttonSpec['class'] : '').'">' |
|
197 | + . (isset($buttonSpec['icon']) ? '<span class="yk-icon yk-icon-'.$buttonSpec['icon'].'"></span> ' : '') |
|
198 | 198 | . $view->translate($buttonSpec['label']) |
199 | 199 | . '</button>'; |
200 | 200 | }, $controlButtons)); |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | } |
235 | 235 | |
236 | 236 | if ($element instanceof ViewPartialProviderInterface) { |
237 | - $renderer = $this->getView(); /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
|
237 | + $renderer = $this->getView(); /* @var $renderer \Zend\View\Renderer\PhpRenderer */ |
|
238 | 238 | $origPartial = $element->getViewPartial(); |
239 | 239 | $partial = "$origPartial.view"; |
240 | - $partialParams = array( |
|
240 | + $partialParams = array( |
|
241 | 241 | 'element' => $element |
242 | 242 | ); |
243 | 243 | if (!$renderer->resolver($partial)) { |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | if ($element instanceof FieldsetInterface) { |
255 | 255 | if (!$element instanceof FormInterface && $label) { |
256 | - $markup .= '<h4>' . $label . '</h4>'; |
|
256 | + $markup .= '<h4>'.$label.'</h4>'; |
|
257 | 257 | } |
258 | 258 | foreach ($element as $el) { |
259 | 259 | $markup .= $this->renderSummaryElement($el); |
@@ -282,11 +282,11 @@ discard block |
||
282 | 282 | if (!is_array($optVal) || !array_key_exists($optionKey, $optVal['options'])) { continue; } |
283 | 283 | |
284 | 284 | $optGroupLabel = isset($optVal['label']) ? $translator->translate($optVal['label']) : $optKey; |
285 | - $multiOptions[] = $optGroupLabel . ' | ' . $translator->translate($optVal['options'][$optionKey]); |
|
285 | + $multiOptions[] = $optGroupLabel.' | '.$translator->translate($optVal['options'][$optionKey]); |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
289 | - $elementValue = '<ul><li>' . join('</li><li>' , $multiOptions) . '</li></ul>'; |
|
289 | + $elementValue = '<ul><li>'.join('</li><li>', $multiOptions).'</li></ul>'; |
|
290 | 290 | // $numberOfmultiOptions = count($multiOptions); |
291 | 291 | // foreach ($multiOptions as $optGroupLabel => $vals) { |
292 | 292 | // $elementValue[] = ($numberOfmultiOptions > 1 || $optGroupLabel !== $generalOptGroupName ? "<b>$optGroupLabel</b><br>" : '') . join(', ', $vals); |
@@ -305,10 +305,10 @@ discard block |
||
305 | 305 | $markup .= '<div class="row">'; |
306 | 306 | $col = 12; |
307 | 307 | if ($label) { |
308 | - $markup .= '<div class="col-md-3 yk-label"><label>' . $label . '</label></div>'; |
|
308 | + $markup .= '<div class="col-md-3 yk-label"><label>'.$label.'</label></div>'; |
|
309 | 309 | $col = 9; |
310 | 310 | } |
311 | - $markup .= '<div class="col-md-' . $col . '">' . $elementValue . '</div>' |
|
311 | + $markup .= '<div class="col-md-'.$col.'">'.$elementValue.'</div>' |
|
312 | 312 | . '</div>'; |
313 | 313 | return $markup; |
314 | 314 | } |