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

Commit 2114085

Browse files
committed
CS fixes
1 parent 473340f commit 2114085

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+264
-248
lines changed

src/Helper/AbstractHtmlElement.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class AbstractHtmlElement extends AbstractHelper
3232
*/
3333
public function getClosingBracket()
3434
{
35-
if (!$this->closingBracket) {
35+
if (! $this->closingBracket) {
3636
if ($this->isXhtml()) {
3737
$this->closingBracket = ' />';
3838
} else {
@@ -74,7 +74,7 @@ protected function htmlAttribs($attribs)
7474

7575
if (('on' == substr($key, 0, 2)) || ('constraints' == $key)) {
7676
// Don't escape event attributes; _do_ substitute double quotes with singles
77-
if (!is_scalar($val)) {
77+
if (! is_scalar($val)) {
7878
// non-scalar data should be cast to JSON first
7979
$val = \Zend\Json\Json::encode($val);
8080
}

src/Helper/Cycle.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Cycle extends AbstractHelper implements Iterator
2828
*
2929
* @var array
3030
*/
31-
protected $data = [self::DEFAULT_NAME=>[]];
31+
protected $data = [self::DEFAULT_NAME => []];
3232

3333
/**
3434
* Actual name of cycle
@@ -42,7 +42,7 @@ class Cycle extends AbstractHelper implements Iterator
4242
*
4343
* @var array
4444
*/
45-
protected $pointers = [self::DEFAULT_NAME =>-1];
45+
protected $pointers = [self::DEFAULT_NAME => -1];
4646

4747
/**
4848
* Add elements to alternate
@@ -53,7 +53,7 @@ class Cycle extends AbstractHelper implements Iterator
5353
*/
5454
public function __invoke(array $data = [], $name = self::DEFAULT_NAME)
5555
{
56-
if (!empty($data)) {
56+
if (! empty($data)) {
5757
$this->data[$name] = $data;
5858
}
5959

@@ -106,11 +106,11 @@ public function setName($name = self::DEFAULT_NAME)
106106
{
107107
$this->name = $name;
108108

109-
if (!isset($this->data[$this->name])) {
109+
if (! isset($this->data[$this->name])) {
110110
$this->data[$this->name] = [];
111111
}
112112

113-
if (!isset($this->pointers[$this->name])) {
113+
if (! isset($this->pointers[$this->name])) {
114114
$this->rewind();
115115
}
116116

src/Helper/DeclareVars.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __invoke()
5454
foreach ($key as $name => $value) {
5555
$this->declareVar($name, $value);
5656
}
57-
} elseif (!isset($view->vars()->$key)) {
57+
} elseif (! isset($view->vars()->$key)) {
5858
$this->declareVar($key);
5959
}
6060
}
@@ -73,7 +73,7 @@ protected function declareVar($key, $value = '')
7373
{
7474
$view = $this->getView();
7575
$vars = $view->vars();
76-
if (!isset($vars->$key)) {
76+
if (! isset($vars->$key)) {
7777
$vars->$key = $value;
7878
}
7979
}

src/Helper/Doctype.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function setDoctype($doctype)
181181
*/
182182
public function getDoctype()
183183
{
184-
if (!isset($this->registry['doctype'])) {
184+
if (! isset($this->registry['doctype'])) {
185185
$this->setDoctype($this->defaultDoctype);
186186
}
187187

src/Helper/Escaper/AbstractHelper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __invoke($value, $recurse = self::RECURSE_NONE)
5252
}
5353

5454
if (is_array($value)) {
55-
if (!(self::RECURSE_ARRAY & $recurse)) {
55+
if (! (self::RECURSE_ARRAY & $recurse)) {
5656
throw new Exception\InvalidArgumentException(
5757
'Array provided to Escape helper, but flags do not allow recursion'
5858
);
@@ -64,7 +64,7 @@ public function __invoke($value, $recurse = self::RECURSE_NONE)
6464
}
6565

6666
if (is_object($value)) {
67-
if (!(self::RECURSE_OBJECT & $recurse)) {
67+
if (! (self::RECURSE_OBJECT & $recurse)) {
6868
// Attempt to cast it to a string
6969
if (method_exists($value, '__toString')) {
7070
return $this->escape((string) $value);

src/Helper/FlashMessenger.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ protected function getEscapeHtmlHelper()
344344
$this->escapeHtmlHelper = $this->view->plugin('escapehtml');
345345
}
346346

347-
if (!$this->escapeHtmlHelper instanceof EscapeHtml) {
347+
if (! $this->escapeHtmlHelper instanceof EscapeHtml) {
348348
$this->escapeHtmlHelper = new EscapeHtml();
349349
}
350350

src/Helper/Gravatar.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ class Gravatar extends AbstractHtmlElement
9393
*/
9494
public function __invoke($email = "", $options = [], $attribs = [])
9595
{
96-
if (!empty($email)) {
96+
if (! empty($email)) {
9797
$this->setEmail($email);
9898
}
99-
if (!empty($options)) {
99+
if (! empty($options)) {
100100
$this->setOptions($options);
101101
}
102-
if (!empty($attribs)) {
102+
if (! empty($attribs)) {
103103
$this->setAttribs($attribs);
104104
}
105105

src/Helper/HeadLink.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function __call($method, $args)
191191
*/
192192
protected function isValid($value)
193193
{
194-
if (!$value instanceof stdClass) {
194+
if (! $value instanceof stdClass) {
195195
return false;
196196
}
197197

@@ -214,7 +214,7 @@ protected function isValid($value)
214214
*/
215215
public function append($value)
216216
{
217-
if (!$this->isValid($value)) {
217+
if (! $this->isValid($value)) {
218218
throw new Exception\InvalidArgumentException(
219219
'append() expects a data token; please use one of the custom append*() methods'
220220
);
@@ -233,7 +233,7 @@ public function append($value)
233233
*/
234234
public function offsetSet($index, $value)
235235
{
236-
if (!$this->isValid($value)) {
236+
if (! $this->isValid($value)) {
237237
throw new Exception\InvalidArgumentException(
238238
'offsetSet() expects a data token; please use one of the custom offsetSet*() methods'
239239
);
@@ -251,7 +251,7 @@ public function offsetSet($index, $value)
251251
*/
252252
public function prepend($value)
253253
{
254-
if (!$this->isValid($value)) {
254+
if (! $this->isValid($value)) {
255255
throw new Exception\InvalidArgumentException(
256256
'prepend() expects a data token; please use one of the custom prepend*() methods'
257257
);
@@ -269,7 +269,7 @@ public function prepend($value)
269269
*/
270270
public function set($value)
271271
{
272-
if (!$this->isValid($value)) {
272+
if (! $this->isValid($value)) {
273273
throw new Exception\InvalidArgumentException(
274274
'set() expects a data token; please use one of the custom set*() methods'
275275
);
@@ -316,7 +316,7 @@ public function itemToString(stdClass $item)
316316
}
317317

318318
if (isset($attributes['conditionalStylesheet'])
319-
&& !empty($attributes['conditionalStylesheet'])
319+
&& ! empty($attributes['conditionalStylesheet'])
320320
&& is_string($attributes['conditionalStylesheet'])
321321
) {
322322
// inner wrap with comment end and start if !IE
@@ -389,7 +389,7 @@ public function createDataStylesheet(array $args)
389389
}
390390
if (0 < count($args)) {
391391
$conditionalStylesheet = array_shift($args);
392-
if (!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
392+
if (! empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
393393
$conditionalStylesheet = (string) $conditionalStylesheet;
394394
} else {
395395
$conditionalStylesheet = null;

src/Helper/HeadMeta.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public function createData($type, $typeValue, $content, array $modifiers)
213213
*/
214214
public function itemToString(stdClass $item)
215215
{
216-
if (!in_array($item->type, $this->typeKeys)) {
216+
if (! in_array($item->type, $this->typeKeys)) {
217217
throw new Exception\InvalidArgumentException(sprintf(
218218
'Invalid type "%s" provided for meta',
219219
$item->type
@@ -230,7 +230,7 @@ public function itemToString(stdClass $item)
230230
'Invalid modifier "scheme" provided; not supported by HTML5'
231231
);
232232
}
233-
if (!in_array($key, $this->modifierKeys)) {
233+
if (! in_array($key, $this->modifierKeys)) {
234234
continue;
235235
}
236236
$modifiersString .= $key . '="' . $this->escape($value) . '" ';
@@ -267,7 +267,7 @@ public function itemToString(stdClass $item)
267267
);
268268

269269
if (isset($item->modifiers['conditional'])
270-
&& !empty($item->modifiers['conditional'])
270+
&& ! empty($item->modifiers['conditional'])
271271
&& is_string($item->modifiers['conditional'])
272272
) {
273273
// inner wrap with comment end and start if !IE
@@ -314,14 +314,14 @@ protected function normalizeType($type)
314314
*/
315315
protected function isValid($item)
316316
{
317-
if ((!$item instanceof stdClass)
318-
|| !isset($item->type)
319-
|| !isset($item->modifiers)
317+
if ((! $item instanceof stdClass)
318+
|| ! isset($item->type)
319+
|| ! isset($item->modifiers)
320320
) {
321321
return false;
322322
}
323323

324-
if (!isset($item->content)
324+
if (! isset($item->content)
325325
&& (! $this->view->plugin('doctype')->isHtml5()
326326
|| (! $this->view->plugin('doctype')->isHtml5() && $item->type !== 'charset'))
327327
) {
@@ -336,7 +336,7 @@ protected function isValid($item)
336336
}
337337

338338
// <meta property= ... /> is only supported with doctype RDFa
339-
if (!$this->view->plugin('doctype')->isRdfa()
339+
if (! $this->view->plugin('doctype')->isRdfa()
340340
&& $item->type === 'property'
341341
) {
342342
return false;
@@ -354,7 +354,7 @@ protected function isValid($item)
354354
*/
355355
public function append($value)
356356
{
357-
if (!$this->isValid($value)) {
357+
if (! $this->isValid($value)) {
358358
throw new Exception\InvalidArgumentException(
359359
'Invalid value passed to append; please use appendMeta()'
360360
);
@@ -373,7 +373,7 @@ public function append($value)
373373
*/
374374
public function offsetSet($index, $value)
375375
{
376-
if (!$this->isValid($value)) {
376+
if (! $this->isValid($value)) {
377377
throw new Exception\InvalidArgumentException(
378378
'Invalid value passed to offsetSet; please use offsetSetName() or offsetSetHttpEquiv()'
379379
);
@@ -391,7 +391,7 @@ public function offsetSet($index, $value)
391391
*/
392392
public function offsetUnset($index)
393393
{
394-
if (!in_array($index, $this->getContainer()->getKeys())) {
394+
if (! in_array($index, $this->getContainer()->getKeys())) {
395395
throw new Exception\InvalidArgumentException('Invalid index passed to offsetUnset()');
396396
}
397397

@@ -407,7 +407,7 @@ public function offsetUnset($index)
407407
*/
408408
public function prepend($value)
409409
{
410-
if (!$this->isValid($value)) {
410+
if (! $this->isValid($value)) {
411411
throw new Exception\InvalidArgumentException(
412412
'Invalid value passed to prepend; please use prependMeta()'
413413
);
@@ -425,7 +425,7 @@ public function prepend($value)
425425
*/
426426
public function set($value)
427427
{
428-
if (!$this->isValid($value)) {
428+
if (! $this->isValid($value)) {
429429
throw new Exception\InvalidArgumentException('Invalid value passed to set; please use setMeta()');
430430
}
431431

0 commit comments

Comments
 (0)