Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 47ed633

Browse files
author
Ralph Schindler
committed
Merge branch 'hotfix/psr-2_compliance' of git://github.com/RWOverdijk/zf2 into RWOverdijk-hotfix/psr-2_compliance
2 parents 3953c79 + f29e5e9 commit 47ed633

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

src/Helper/Cycle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Cycle extends AbstractHelper implements \Iterator
5555
*/
5656
public function __invoke(array $data = array(), $name = self::DEFAULT_NAME)
5757
{
58-
if(!empty($data))
58+
if (!empty($data))
5959
$this->data[$name] = $data;
6060

6161
$this->setName($name);
@@ -87,10 +87,10 @@ public function setName($name = self::DEFAULT_NAME)
8787
{
8888
$this->name = $name;
8989

90-
if(!isset($this->data[$this->name]))
90+
if (!isset($this->data[$this->name]))
9191
$this->data[$this->name] = array();
9292

93-
if(!isset($this->pointers[$this->name]))
93+
if (!isset($this->pointers[$this->name]))
9494
$this->rewind();
9595

9696
return $this;

src/Helper/DeclareVars.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __invoke()
5252
{
5353
$view = $this->getView();
5454
$args = func_get_args();
55-
foreach($args as $key) {
55+
foreach ($args as $key) {
5656
if (is_array($key)) {
5757
foreach ($key as $name => $value) {
5858
$this->declareVar($name, $value);

src/Helper/HeadLink.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ public function itemToString(\stdClass $item)
262262

263263
foreach ($this->itemKeys as $itemKey) {
264264
if (isset($attributes[$itemKey])) {
265-
if(is_array($attributes[$itemKey])) {
266-
foreach($attributes[$itemKey] as $key => $value) {
265+
if (is_array($attributes[$itemKey])) {
266+
foreach ($attributes[$itemKey] as $key => $value) {
267267
$link .= sprintf('%s="%s" ', $key, ($this->autoEscape) ? $this->escape($value) : $value);
268268
}
269269
} else {
@@ -345,22 +345,22 @@ public function createDataStylesheet(array $args)
345345

346346
if (0 < count($args)) {
347347
$media = array_shift($args);
348-
if(is_array($media)) {
348+
if (is_array($media)) {
349349
$media = implode(',', $media);
350350
} else {
351351
$media = (string) $media;
352352
}
353353
}
354354
if (0 < count($args)) {
355355
$conditionalStylesheet = array_shift($args);
356-
if(!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
356+
if (!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
357357
$conditionalStylesheet = (string) $conditionalStylesheet;
358358
} else {
359359
$conditionalStylesheet = null;
360360
}
361361
}
362362

363-
if(0 < count($args) && is_array($args[0])) {
363+
if (0 < count($args) && is_array($args[0])) {
364364
$extras = array_shift($args);
365365
$extras = (array) $extras;
366366
}
@@ -406,11 +406,11 @@ public function createDataAlternate(array $args)
406406
$type = array_shift($args);
407407
$title = array_shift($args);
408408

409-
if(0 < count($args) && is_array($args[0])) {
409+
if (0 < count($args) && is_array($args[0])) {
410410
$extras = array_shift($args);
411411
$extras = (array) $extras;
412412

413-
if(isset($extras['media']) && is_array($extras['media'])) {
413+
if (isset($extras['media']) && is_array($extras['media'])) {
414414
$extras['media'] = implode(',', $extras['media']);
415415
}
416416
}

src/Helper/HeadStyle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,14 @@ public function itemToString(\stdClass $item, $indent)
316316
continue;
317317
}
318318
if ('media' == $key) {
319-
if(false === strpos($value, ',')) {
319+
if (false === strpos($value, ',')) {
320320
if (!in_array($value, $this->mediaTypes)) {
321321
continue;
322322
}
323323
} else {
324324
$media_types = explode(',', $value);
325325
$value = '';
326-
foreach($media_types as $type) {
326+
foreach ($media_types as $type) {
327327
$type = trim($type);
328328
if (!in_array($type, $this->mediaTypes)) {
329329
continue;
@@ -395,7 +395,7 @@ public function createData($content, array $attributes)
395395
{
396396
if (!isset($attributes['media'])) {
397397
$attributes['media'] = 'screen';
398-
} else if(is_array($attributes['media'])) {
398+
} elseif (is_array($attributes['media'])) {
399399
$attributes['media'] = implode(',', $attributes['media']);
400400
}
401401

src/Model/ConsoleModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function setErrorLevel($errorLevel)
6464
*/
6565
public function getErrorLevel()
6666
{
67-
if(array_key_exists('errorLevel', $this->options)){
67+
if (array_key_exists('errorLevel', $this->options)) {
6868
return $this->options['errorLevel'];
6969
}
7070
}

src/Model/JsonModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function serialize()
6767
$variables = ArrayUtils::iteratorToArray($variables);
6868
}
6969

70-
if(!is_null($this->jsonpCallback)) {
70+
if (!is_null($this->jsonpCallback)) {
7171
return $this->jsonpCallback.'('.Json::encode($variables).');';
7272
} else {
7373
return Json::encode($variables);

src/Model/ViewModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ public function getOptions()
221221
public function getVariable($name, $default = null)
222222
{
223223
$name = (string)$name;
224-
if(array_key_exists($name,$this->variables)){
224+
if (array_key_exists($name,$this->variables)) {
225225
return $this->variables[$name];
226-
}else{
226+
} else {
227227
return $default;
228228
}
229229
}

src/Renderer/ConsoleRenderer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct($config = array())
6666
$this->init();
6767
}
6868

69-
public function setResolver(Resolver $resolver){}
69+
public function setResolver(Resolver $resolver) {}
7070

7171
/**
7272
* Return the template engine object
@@ -128,7 +128,7 @@ public function getFilterChain()
128128
*/
129129
public function render($model, $values = null)
130130
{
131-
if(!$model instanceof Model){
131+
if (!$model instanceof Model) {
132132
return '';
133133
}
134134

@@ -145,14 +145,14 @@ public function render($model, $values = null)
145145

146146
$values = $model->getVariables();
147147

148-
if(isset($values['result'])){
148+
if (isset($values['result'])) {
149149
// filter and append the result
150150
$result .= $this->getFilterChain()->filter($values['result']);
151151
}
152152

153-
if($model->hasChildren()){
153+
if ($model->hasChildren()) {
154154
// recursively render all children
155-
foreach($model->getChildren() as $child){
155+
foreach ($model->getChildren() as $child) {
156156
$result .= $this->render($child, $values);
157157
}
158158
}

src/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected function renderChildren(Model $model)
231231
$child->setOption('has_parent', null);
232232
$capture = $child->captureTo();
233233
if (!empty($capture)) {
234-
if($child->isAppend()) {
234+
if ($child->isAppend()) {
235235
$oldResult=$model->{$capture};
236236
$model->setVariable($capture, $oldResult.$result);
237237
} else {

src/ViewEvent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function getResult()
174174
*/
175175
public function getParam($name, $default = null)
176176
{
177-
switch($name) {
177+
switch ($name) {
178178
case 'model':
179179
return $this->getModel();
180180
case 'renderer':

0 commit comments

Comments
 (0)