diff --git a/src/Helper/AbstractHtmlElement.php b/src/Helper/AbstractHtmlElement.php
index 3cf73e9f..98a250b1 100644
--- a/src/Helper/AbstractHtmlElement.php
+++ b/src/Helper/AbstractHtmlElement.php
@@ -32,7 +32,7 @@ abstract class AbstractHtmlElement extends AbstractHelper
*/
public function getClosingBracket()
{
- if (!$this->closingBracket) {
+ if (! $this->closingBracket) {
if ($this->isXhtml()) {
$this->closingBracket = ' />';
} else {
@@ -74,7 +74,7 @@ protected function htmlAttribs($attribs)
if (('on' == substr($key, 0, 2)) || ('constraints' == $key)) {
// Don't escape event attributes; _do_ substitute double quotes with singles
- if (!is_scalar($val)) {
+ if (! is_scalar($val)) {
// non-scalar data should be cast to JSON first
$val = \Zend\Json\Json::encode($val);
}
diff --git a/src/Helper/Cycle.php b/src/Helper/Cycle.php
index 460ffae1..5f71a783 100644
--- a/src/Helper/Cycle.php
+++ b/src/Helper/Cycle.php
@@ -28,7 +28,7 @@ class Cycle extends AbstractHelper implements Iterator
*
* @var array
*/
- protected $data = [self::DEFAULT_NAME=>[]];
+ protected $data = [self::DEFAULT_NAME => []];
/**
* Actual name of cycle
@@ -42,7 +42,7 @@ class Cycle extends AbstractHelper implements Iterator
*
* @var array
*/
- protected $pointers = [self::DEFAULT_NAME =>-1];
+ protected $pointers = [self::DEFAULT_NAME => -1];
/**
* Add elements to alternate
@@ -53,7 +53,7 @@ class Cycle extends AbstractHelper implements Iterator
*/
public function __invoke(array $data = [], $name = self::DEFAULT_NAME)
{
- if (!empty($data)) {
+ if (! empty($data)) {
$this->data[$name] = $data;
}
@@ -106,11 +106,11 @@ public function setName($name = self::DEFAULT_NAME)
{
$this->name = $name;
- if (!isset($this->data[$this->name])) {
+ if (! isset($this->data[$this->name])) {
$this->data[$this->name] = [];
}
- if (!isset($this->pointers[$this->name])) {
+ if (! isset($this->pointers[$this->name])) {
$this->rewind();
}
diff --git a/src/Helper/DeclareVars.php b/src/Helper/DeclareVars.php
index 4be8129d..a503d519 100644
--- a/src/Helper/DeclareVars.php
+++ b/src/Helper/DeclareVars.php
@@ -54,7 +54,7 @@ public function __invoke()
foreach ($key as $name => $value) {
$this->declareVar($name, $value);
}
- } elseif (!isset($view->vars()->$key)) {
+ } elseif (! isset($view->vars()->$key)) {
$this->declareVar($key);
}
}
@@ -73,7 +73,7 @@ protected function declareVar($key, $value = '')
{
$view = $this->getView();
$vars = $view->vars();
- if (!isset($vars->$key)) {
+ if (! isset($vars->$key)) {
$vars->$key = $value;
}
}
diff --git a/src/Helper/Doctype.php b/src/Helper/Doctype.php
index a1fcd293..5eab7f87 100644
--- a/src/Helper/Doctype.php
+++ b/src/Helper/Doctype.php
@@ -181,7 +181,7 @@ public function setDoctype($doctype)
*/
public function getDoctype()
{
- if (!isset($this->registry['doctype'])) {
+ if (! isset($this->registry['doctype'])) {
$this->setDoctype($this->defaultDoctype);
}
diff --git a/src/Helper/Escaper/AbstractHelper.php b/src/Helper/Escaper/AbstractHelper.php
index 7dc8aa71..99643e7d 100644
--- a/src/Helper/Escaper/AbstractHelper.php
+++ b/src/Helper/Escaper/AbstractHelper.php
@@ -52,7 +52,7 @@ public function __invoke($value, $recurse = self::RECURSE_NONE)
}
if (is_array($value)) {
- if (!(self::RECURSE_ARRAY & $recurse)) {
+ if (! (self::RECURSE_ARRAY & $recurse)) {
throw new Exception\InvalidArgumentException(
'Array provided to Escape helper, but flags do not allow recursion'
);
@@ -64,7 +64,7 @@ public function __invoke($value, $recurse = self::RECURSE_NONE)
}
if (is_object($value)) {
- if (!(self::RECURSE_OBJECT & $recurse)) {
+ if (! (self::RECURSE_OBJECT & $recurse)) {
// Attempt to cast it to a string
if (method_exists($value, '__toString')) {
return $this->escape((string) $value);
diff --git a/src/Helper/FlashMessenger.php b/src/Helper/FlashMessenger.php
index 193b254d..bcbd2be5 100644
--- a/src/Helper/FlashMessenger.php
+++ b/src/Helper/FlashMessenger.php
@@ -344,7 +344,7 @@ protected function getEscapeHtmlHelper()
$this->escapeHtmlHelper = $this->view->plugin('escapehtml');
}
- if (!$this->escapeHtmlHelper instanceof EscapeHtml) {
+ if (! $this->escapeHtmlHelper instanceof EscapeHtml) {
$this->escapeHtmlHelper = new EscapeHtml();
}
diff --git a/src/Helper/Gravatar.php b/src/Helper/Gravatar.php
index 57ae33fd..13c3bb10 100644
--- a/src/Helper/Gravatar.php
+++ b/src/Helper/Gravatar.php
@@ -93,13 +93,13 @@ class Gravatar extends AbstractHtmlElement
*/
public function __invoke($email = "", $options = [], $attribs = [])
{
- if (!empty($email)) {
+ if (! empty($email)) {
$this->setEmail($email);
}
- if (!empty($options)) {
+ if (! empty($options)) {
$this->setOptions($options);
}
- if (!empty($attribs)) {
+ if (! empty($attribs)) {
$this->setAttribs($attribs);
}
diff --git a/src/Helper/HeadLink.php b/src/Helper/HeadLink.php
index 1a640595..050d4e17 100644
--- a/src/Helper/HeadLink.php
+++ b/src/Helper/HeadLink.php
@@ -191,7 +191,7 @@ public function __call($method, $args)
*/
protected function isValid($value)
{
- if (!$value instanceof stdClass) {
+ if (! $value instanceof stdClass) {
return false;
}
@@ -214,7 +214,7 @@ protected function isValid($value)
*/
public function append($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'append() expects a data token; please use one of the custom append*() methods'
);
@@ -233,7 +233,7 @@ public function append($value)
*/
public function offsetSet($index, $value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'offsetSet() expects a data token; please use one of the custom offsetSet*() methods'
);
@@ -251,7 +251,7 @@ public function offsetSet($index, $value)
*/
public function prepend($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'prepend() expects a data token; please use one of the custom prepend*() methods'
);
@@ -269,7 +269,7 @@ public function prepend($value)
*/
public function set($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'set() expects a data token; please use one of the custom set*() methods'
);
@@ -316,7 +316,7 @@ public function itemToString(stdClass $item)
}
if (isset($attributes['conditionalStylesheet'])
- && !empty($attributes['conditionalStylesheet'])
+ && ! empty($attributes['conditionalStylesheet'])
&& is_string($attributes['conditionalStylesheet'])
) {
// inner wrap with comment end and start if !IE
@@ -389,7 +389,7 @@ public function createDataStylesheet(array $args)
}
if (0 < count($args)) {
$conditionalStylesheet = array_shift($args);
- if (!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
+ if (! empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
$conditionalStylesheet = (string) $conditionalStylesheet;
} else {
$conditionalStylesheet = null;
diff --git a/src/Helper/HeadMeta.php b/src/Helper/HeadMeta.php
index b14702f5..38595c81 100644
--- a/src/Helper/HeadMeta.php
+++ b/src/Helper/HeadMeta.php
@@ -213,7 +213,7 @@ public function createData($type, $typeValue, $content, array $modifiers)
*/
public function itemToString(stdClass $item)
{
- if (!in_array($item->type, $this->typeKeys)) {
+ if (! in_array($item->type, $this->typeKeys)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid type "%s" provided for meta',
$item->type
@@ -230,7 +230,7 @@ public function itemToString(stdClass $item)
'Invalid modifier "scheme" provided; not supported by HTML5'
);
}
- if (!in_array($key, $this->modifierKeys)) {
+ if (! in_array($key, $this->modifierKeys)) {
continue;
}
$modifiersString .= $key . '="' . $this->escape($value) . '" ';
@@ -267,7 +267,7 @@ public function itemToString(stdClass $item)
);
if (isset($item->modifiers['conditional'])
- && !empty($item->modifiers['conditional'])
+ && ! empty($item->modifiers['conditional'])
&& is_string($item->modifiers['conditional'])
) {
// inner wrap with comment end and start if !IE
@@ -314,14 +314,14 @@ protected function normalizeType($type)
*/
protected function isValid($item)
{
- if ((!$item instanceof stdClass)
- || !isset($item->type)
- || !isset($item->modifiers)
+ if ((! $item instanceof stdClass)
+ || ! isset($item->type)
+ || ! isset($item->modifiers)
) {
return false;
}
- if (!isset($item->content)
+ if (! isset($item->content)
&& (! $this->view->plugin('doctype')->isHtml5()
|| (! $this->view->plugin('doctype')->isHtml5() && $item->type !== 'charset'))
) {
@@ -336,7 +336,7 @@ protected function isValid($item)
}
// is only supported with doctype RDFa
- if (!$this->view->plugin('doctype')->isRdfa()
+ if (! $this->view->plugin('doctype')->isRdfa()
&& $item->type === 'property'
) {
return false;
@@ -354,7 +354,7 @@ protected function isValid($item)
*/
public function append($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to append; please use appendMeta()'
);
@@ -373,7 +373,7 @@ public function append($value)
*/
public function offsetSet($index, $value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to offsetSet; please use offsetSetName() or offsetSetHttpEquiv()'
);
@@ -391,7 +391,7 @@ public function offsetSet($index, $value)
*/
public function offsetUnset($index)
{
- if (!in_array($index, $this->getContainer()->getKeys())) {
+ if (! in_array($index, $this->getContainer()->getKeys())) {
throw new Exception\InvalidArgumentException('Invalid index passed to offsetUnset()');
}
@@ -407,7 +407,7 @@ public function offsetUnset($index)
*/
public function prepend($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to prepend; please use prependMeta()'
);
@@ -425,7 +425,7 @@ public function prepend($value)
*/
public function set($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException('Invalid value passed to set; please use setMeta()');
}
diff --git a/src/Helper/HeadScript.php b/src/Helper/HeadScript.php
index b0dc179e..d20d1a7f 100644
--- a/src/Helper/HeadScript.php
+++ b/src/Helper/HeadScript.php
@@ -211,7 +211,7 @@ public function __call($method, $args)
break;
case 'file':
default:
- if (!$this->isDuplicate($content)) {
+ if (! $this->isDuplicate($content)) {
$attrs['src'] = $content;
$item = $this->createData($type, $attrs);
if ('offsetSet' == $action) {
@@ -253,7 +253,7 @@ public function toString($indent = null)
$items = [];
$this->getContainer()->ksort();
foreach ($this as $item) {
- if (!$this->isValid($item)) {
+ if (! $this->isValid($item)) {
continue;
}
@@ -362,10 +362,10 @@ protected function isDuplicate($file)
*/
protected function isValid($value)
{
- if ((!$value instanceof stdClass)
- || !isset($value->type)
- || (!isset($value->source)
- && !isset($value->attributes))
+ if ((! $value instanceof stdClass)
+ || ! isset($value->type)
+ || (! isset($value->source)
+ && ! isset($value->attributes))
) {
return false;
}
@@ -385,9 +385,9 @@ protected function isValid($value)
public function itemToString($item, $indent, $escapeStart, $escapeEnd)
{
$attrString = '';
- if (!empty($item->attributes)) {
+ if (! empty($item->attributes)) {
foreach ($item->attributes as $key => $value) {
- if ((!$this->arbitraryAttributesAllowed() && !in_array($key, $this->optionalAttributes))
+ if ((! $this->arbitraryAttributesAllowed() && ! in_array($key, $this->optionalAttributes))
|| in_array($key, ['conditional', 'noescape'])) {
continue;
}
@@ -401,7 +401,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
}
}
- $addScriptEscape = !(isset($item->attributes['noescape'])
+ $addScriptEscape = ! (isset($item->attributes['noescape'])
&& filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));
if (empty($item->type) && $this->view && $this->view->plugin('doctype')->isHtml5()) {
@@ -410,7 +410,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
$type = ($this->autoEscape) ? $this->escape($item->type) : $item->type;
$html = '';
if (isset($item->attributes['conditional'])
- && !empty($item->attributes['conditional'])
+ && ! empty($item->attributes['conditional'])
&& is_string($item->attributes['conditional'])
) {
// inner wrap with comment end and start if !IE
@@ -452,7 +452,7 @@ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
*/
public function append($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid argument passed to append(); '
. 'please use one of the helper methods, appendScript() or appendFile()'
@@ -471,7 +471,7 @@ public function append($value)
*/
public function prepend($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid argument passed to prepend(); '
. 'please use one of the helper methods, prependScript() or prependFile()'
@@ -490,7 +490,7 @@ public function prepend($value)
*/
public function set($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid argument passed to set(); please use one of the helper methods, setScript() or setFile()'
);
@@ -509,7 +509,7 @@ public function set($value)
*/
public function offsetSet($index, $value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid argument passed to offsetSet(); '
. 'please use one of the helper methods, offsetSetScript() or offsetSetFile()'
diff --git a/src/Helper/HeadStyle.php b/src/Helper/HeadStyle.php
index 2c030057..8536aed1 100644
--- a/src/Helper/HeadStyle.php
+++ b/src/Helper/HeadStyle.php
@@ -176,7 +176,7 @@ public function toString($indent = null)
$items = [];
$this->getContainer()->ksort();
foreach ($this as $item) {
- if (!$this->isValid($item)) {
+ if (! $this->isValid($item)) {
continue;
}
$items[] = $this->itemToString($item, $indent);
@@ -243,7 +243,7 @@ public function captureEnd()
*/
public function createData($content, array $attributes)
{
- if (!isset($attributes['media'])) {
+ if (! isset($attributes['media'])) {
$attributes['media'] = 'screen';
} elseif (is_array($attributes['media'])) {
$attributes['media'] = implode(',', $attributes['media']);
@@ -264,7 +264,7 @@ public function createData($content, array $attributes)
*/
protected function isValid($value)
{
- if ((!$value instanceof stdClass) || !isset($value->content) || !isset($value->attributes)) {
+ if ((! $value instanceof stdClass) || ! isset($value->content) || ! isset($value->attributes)) {
return false;
}
@@ -281,7 +281,7 @@ protected function isValid($value)
public function itemToString(stdClass $item, $indent)
{
$attrString = '';
- if (!empty($item->attributes)) {
+ if (! empty($item->attributes)) {
$enc = 'UTF-8';
if ($this->view instanceof View\Renderer\RendererInterface
&& method_exists($this->view, 'getEncoding')
@@ -290,12 +290,12 @@ public function itemToString(stdClass $item, $indent)
}
$escaper = $this->getEscaper($enc);
foreach ($item->attributes as $key => $value) {
- if (!in_array($key, $this->optionalAttributes)) {
+ if (! in_array($key, $this->optionalAttributes)) {
continue;
}
if ('media' == $key) {
if (false === strpos($value, ',')) {
- if (!in_array($value, $this->mediaTypes)) {
+ if (! in_array($value, $this->mediaTypes)) {
continue;
}
} else {
@@ -303,7 +303,7 @@ public function itemToString(stdClass $item, $indent)
$value = '';
foreach ($mediaTypes as $type) {
$type = trim($type);
- if (!in_array($type, $this->mediaTypes)) {
+ if (! in_array($type, $this->mediaTypes)) {
continue;
}
$value .= $type .',';
@@ -318,7 +318,7 @@ public function itemToString(stdClass $item, $indent)
$escapeStart = $indent . '' . PHP_EOL;
if (isset($item->attributes['conditional'])
- && !empty($item->attributes['conditional'])
+ && ! empty($item->attributes['conditional'])
&& is_string($item->attributes['conditional'])
) {
$escapeStart = null;
@@ -349,7 +349,7 @@ public function itemToString(stdClass $item, $indent)
*/
public function append($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to append; please use appendStyle()'
);
@@ -368,7 +368,7 @@ public function append($value)
*/
public function offsetSet($index, $value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to offsetSet; please use offsetSetStyle()'
);
@@ -386,7 +386,7 @@ public function offsetSet($index, $value)
*/
public function prepend($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException(
'Invalid value passed to prepend; please use prependStyle()'
);
@@ -404,7 +404,7 @@ public function prepend($value)
*/
public function set($value)
{
- if (!$this->isValid($value)) {
+ if (! $this->isValid($value)) {
throw new Exception\InvalidArgumentException('Invalid value passed to set; please use setStyle()');
}
diff --git a/src/Helper/HeadTitle.php b/src/Helper/HeadTitle.php
index 6af45a85..b5e9c79f 100644
--- a/src/Helper/HeadTitle.php
+++ b/src/Helper/HeadTitle.php
@@ -121,7 +121,7 @@ public function renderTitle()
*/
public function setDefaultAttachOrder($setType)
{
- if (!in_array($setType, [
+ if (! in_array($setType, [
Placeholder\Container\AbstractContainer::APPEND,
Placeholder\Container\AbstractContainer::SET,
Placeholder\Container\AbstractContainer::PREPEND
diff --git a/src/Helper/HtmlList.php b/src/Helper/HtmlList.php
index 76bf67e1..8e3a4e9e 100644
--- a/src/Helper/HtmlList.php
+++ b/src/Helper/HtmlList.php
@@ -38,7 +38,7 @@ public function __invoke(array $items, $ordered = false, $attribs = false, $esca
$list = '';
foreach ($items as $item) {
- if (!is_array($item)) {
+ if (! is_array($item)) {
if ($escape) {
$escaper = $this->getView()->plugin('escapeHtml');
$item = $escaper($item);
diff --git a/src/Helper/HtmlTag.php b/src/Helper/HtmlTag.php
index ebc89582..2e9cfce2 100644
--- a/src/Helper/HtmlTag.php
+++ b/src/Helper/HtmlTag.php
@@ -45,7 +45,7 @@ class HtmlTag extends AbstractHtmlElement
*/
public function __invoke(array $attribs = [])
{
- if (!empty($attribs)) {
+ if (! empty($attribs)) {
$this->setAttributes($attribs);
}
@@ -119,7 +119,7 @@ public function openTag()
protected function handleNamespaceAttributes()
{
- if ($this->useNamespaces && !$this->handledNamespaces) {
+ if ($this->useNamespaces && ! $this->handledNamespaces) {
if (method_exists($this->view, 'plugin')) {
$doctypeAttributes = [];
@@ -127,7 +127,7 @@ protected function handleNamespaceAttributes()
$doctypeAttributes = ['xmlns' => 'http://www.w3.org/1999/xhtml'];
}
- if (!empty($doctypeAttributes)) {
+ if (! empty($doctypeAttributes)) {
$this->attributes = array_merge($doctypeAttributes, $this->attributes);
}
}
diff --git a/src/Helper/Identity.php b/src/Helper/Identity.php
index 91cc96c2..cbd36430 100644
--- a/src/Helper/Identity.php
+++ b/src/Helper/Identity.php
@@ -34,11 +34,11 @@ class Identity extends AbstractHelper
*/
public function __invoke()
{
- if (!$this->authenticationService instanceof AuthenticationServiceInterface) {
+ if (! $this->authenticationService instanceof AuthenticationServiceInterface) {
throw new Exception\RuntimeException('No AuthenticationServiceInterface instance provided');
}
- if (!$this->authenticationService->hasIdentity()) {
+ if (! $this->authenticationService->hasIdentity()) {
return;
}
diff --git a/src/Helper/Layout.php b/src/Helper/Layout.php
index 6554b169..2a458ee2 100644
--- a/src/Helper/Layout.php
+++ b/src/Helper/Layout.php
@@ -60,7 +60,7 @@ protected function getRoot()
{
$helper = $this->getViewModelHelper();
- if (!$helper->hasRoot()) {
+ if (! $helper->hasRoot()) {
throw new Exception\RuntimeException(sprintf(
'%s: no view model currently registered as root in renderer',
__METHOD__
diff --git a/src/Helper/Navigation.php b/src/Helper/Navigation.php
index 8eb37b22..233df0b1 100644
--- a/src/Helper/Navigation.php
+++ b/src/Helper/Navigation.php
@@ -149,7 +149,7 @@ public function render($container = null)
public function findHelper($proxy, $strict = true)
{
$plugins = $this->getPluginManager();
- if (!$plugins->has($proxy)) {
+ if (! $plugins->has($proxy)) {
if ($strict) {
throw new Exception\RuntimeException(sprintf(
'Failed to find plugin for %s',
@@ -163,7 +163,7 @@ public function findHelper($proxy, $strict = true)
$container = $this->getContainer();
$hash = spl_object_hash($container) . spl_object_hash($helper);
- if (!isset($this->injected[$hash])) {
+ if (! isset($this->injected[$hash])) {
$helper->setContainer();
$this->inject($helper);
$this->injected[$hash] = true;
@@ -185,20 +185,20 @@ public function findHelper($proxy, $strict = true)
*/
protected function inject(NavigationHelper $helper)
{
- if ($this->getInjectContainer() && !$helper->hasContainer()) {
+ if ($this->getInjectContainer() && ! $helper->hasContainer()) {
$helper->setContainer($this->getContainer());
}
if ($this->getInjectAcl()) {
- if (!$helper->hasAcl()) {
+ if (! $helper->hasAcl()) {
$helper->setAcl($this->getAcl());
}
- if (!$helper->hasRole()) {
+ if (! $helper->hasRole()) {
$helper->setRole($this->getRole());
}
}
- if ($this->getInjectTranslator() && !$helper->hasTranslator()) {
+ if ($this->getInjectTranslator() && ! $helper->hasTranslator()) {
$helper->setTranslator(
$this->getTranslator(),
$this->getTranslatorTextDomain()
diff --git a/src/Helper/Navigation/AbstractHelper.php b/src/Helper/Navigation/AbstractHelper.php
index f8388a2a..827269b4 100644
--- a/src/Helper/Navigation/AbstractHelper.php
+++ b/src/Helper/Navigation/AbstractHelper.php
@@ -179,10 +179,10 @@ public function __toString()
public function findActive($container, $minDepth = null, $maxDepth = -1)
{
$this->parseContainer($container);
- if (!is_int($minDepth)) {
+ if (! is_int($minDepth)) {
$minDepth = $this->getMinDepth();
}
- if ((!is_int($maxDepth) || $maxDepth < 0) && null !== $maxDepth) {
+ if ((! is_int($maxDepth) || $maxDepth < 0) && null !== $maxDepth) {
$maxDepth = $this->getMaxDepth();
}
@@ -196,7 +196,7 @@ public function findActive($container, $minDepth = null, $maxDepth = -1)
/** @var \Zend\Navigation\Page\AbstractPage $page */
foreach ($iterator as $page) {
$currDepth = $iterator->getDepth();
- if ($currDepth < $minDepth || !$this->accept($page)) {
+ if ($currDepth < $minDepth || ! $this->accept($page)) {
// page is not accepted
continue;
}
@@ -216,7 +216,7 @@ public function findActive($container, $minDepth = null, $maxDepth = -1)
}
$found = $found->getParent();
- if (!$found instanceof AbstractPage) {
+ if (! $found instanceof AbstractPage) {
$found = null;
break;
}
@@ -258,7 +258,7 @@ protected function parseContainer(&$container = null)
return;
}
- if (!$container instanceof Navigation\AbstractContainer) {
+ if (! $container instanceof Navigation\AbstractContainer) {
throw new Exception\InvalidArgumentException(
'Container must be a string alias or an instance of '
. 'Zend\Navigation\AbstractContainer'
@@ -295,7 +295,7 @@ public function accept(AbstractPage $page, $recursive = true)
{
$accept = true;
- if (!$page->isVisible(false) && !$this->getRenderInvisible()) {
+ if (! $page->isVisible(false) && ! $this->getRenderInvisible()) {
$accept = false;
} elseif ($this->getUseAcl()) {
$acl = $this->getAcl();
@@ -358,7 +358,7 @@ protected function htmlAttribs($attribs)
{
// filter out null values and empty string values
foreach ($attribs as $key => $value) {
- if ($value === null || (is_string($value) && !strlen($value))) {
+ if ($value === null || (is_string($value) && ! strlen($value))) {
unset($attribs[$key]);
}
}
@@ -637,7 +637,7 @@ public function setMinDepth($minDepth = null)
*/
public function getMinDepth()
{
- if (!is_int($this->minDepth) || $this->minDepth < 0) {
+ if (! is_int($this->minDepth) || $this->minDepth < 0) {
return 0;
}
@@ -847,7 +847,7 @@ public static function setDefaultRole($role = null)
*/
protected function setDefaultListeners()
{
- if (!$this->getUseAcl()) {
+ if (! $this->getUseAcl()) {
return;
}
diff --git a/src/Helper/Navigation/Breadcrumbs.php b/src/Helper/Navigation/Breadcrumbs.php
index 042db8e8..7cf119cb 100644
--- a/src/Helper/Navigation/Breadcrumbs.php
+++ b/src/Helper/Navigation/Breadcrumbs.php
@@ -97,7 +97,7 @@ public function renderStraight($container = null)
}
// find deepest active
- if (!$active = $this->findActive($container)) {
+ if (! $active = $this->findActive($container)) {
return '';
}
diff --git a/src/Helper/Navigation/Links.php b/src/Helper/Navigation/Links.php
index ec4d533f..bd757e93 100644
--- a/src/Helper/Navigation/Links.php
+++ b/src/Helper/Navigation/Links.php
@@ -196,14 +196,14 @@ public function render($container = null)
*/
public function renderLink(AbstractPage $page, $attrib, $relation)
{
- if (!in_array($attrib, ['rel', 'rev'])) {
+ if (! in_array($attrib, ['rel', 'rev'])) {
throw new Exception\DomainException(sprintf(
'Invalid relation attribute "%s", must be "rel" or "rev"',
$attrib
));
}
- if (!$href = $page->getHref()) {
+ if (! $href = $page->getHref()) {
return '';
}
@@ -248,7 +248,7 @@ public function renderLink(AbstractPage $page, $attrib, $relation)
*/
public function findAllRelations(AbstractPage $page, $flag = null)
{
- if (!is_int($flag)) {
+ if (! is_int($flag)) {
$flag = self::RENDER_ALL;
}
@@ -260,16 +260,16 @@ public function findAllRelations(AbstractPage $page, $flag = null)
$types = array_merge($native, array_diff($page->$meth(), $native));
foreach ($types as $type) {
- if (!$relFlag = array_search($type, static::$RELATIONS)) {
+ if (! $relFlag = array_search($type, static::$RELATIONS)) {
$relFlag = self::RENDER_CUSTOM;
}
- if (!($flag & $relFlag)) {
+ if (! ($flag & $relFlag)) {
continue;
}
$found = $this->findRelation($page, $rel, $type);
if ($found) {
- if (!is_array($found)) {
+ if (! is_array($found)) {
$found = [$found];
}
$result[$rel][$type] = $found;
@@ -294,14 +294,14 @@ public function findAllRelations(AbstractPage $page, $flag = null)
*/
public function findRelation(AbstractPage $page, $rel, $type)
{
- if (!in_array($rel, ['rel', 'rev'])) {
+ if (! in_array($rel, ['rel', 'rev'])) {
throw new Exception\DomainException(sprintf(
'Invalid argument: $rel must be "rel" or "rev"; "%s" given',
$rel
));
}
- if (!$result = $this->findFromProperty($page, $rel, $type)) {
+ if (! $result = $this->findFromProperty($page, $rel, $type)) {
$result = $this->findFromSearch($page, $rel, $type);
}
@@ -324,12 +324,12 @@ protected function findFromProperty(AbstractPage $page, $rel, $type)
if ($result) {
$result = $this->convertToPages($result);
if ($result) {
- if (!is_array($result)) {
+ if (! is_array($result)) {
$result = [$result];
}
foreach ($result as $key => $page) {
- if (!$this->accept($page)) {
+ if (! $this->accept($page)) {
unset($result[$key]);
}
}
@@ -379,12 +379,12 @@ protected function findFromSearch(AbstractPage $page, $rel, $type)
public function searchRelStart(AbstractPage $page)
{
$found = $this->findRoot($page);
- if (!$found instanceof AbstractPage) {
+ if (! $found instanceof AbstractPage) {
$found->rewind();
$found = $found->current();
}
- if ($found === $page || !$this->accept($found)) {
+ if ($found === $page || ! $this->accept($found)) {
$found = null;
}
@@ -444,7 +444,7 @@ public function searchRelPrev(AbstractPage $page)
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($iterator as $intermediate) {
- if (!$this->accept($intermediate)) {
+ if (! $this->accept($intermediate)) {
continue;
}
if ($intermediate === $page) {
@@ -477,14 +477,14 @@ public function searchRelChapter(AbstractPage $page)
// find start page(s)
$start = $this->findRelation($page, 'rel', 'start');
- if (!is_array($start)) {
+ if (! is_array($start)) {
$start = [$start];
}
foreach ($root as $chapter) {
// exclude self and start page from chapters
if ($chapter !== $page &&
- !in_array($chapter, $start) &&
+ ! in_array($chapter, $start) &&
$this->accept($chapter)) {
$found[] = $chapter;
}
@@ -689,7 +689,7 @@ protected function convertToPages($mixed, $recursive = true)
]);
}
- if (is_array($mixed) && !empty($mixed)) {
+ if (is_array($mixed) && ! empty($mixed)) {
if ($recursive && is_numeric(key($mixed))) {
// first key is numeric; assume several pages
$pages = [];
diff --git a/src/Helper/Navigation/Listener/AclListener.php b/src/Helper/Navigation/Listener/AclListener.php
index 95c85309..caf06192 100644
--- a/src/Helper/Navigation/Listener/AclListener.php
+++ b/src/Helper/Navigation/Listener/AclListener.php
@@ -38,7 +38,7 @@ public static function accept(Event $event)
$page = $params['page'];
$role = $params['role'];
- if (!$acl) {
+ if (! $acl) {
return $accepted;
}
diff --git a/src/Helper/Navigation/Menu.php b/src/Helper/Navigation/Menu.php
index 0b25e98c..69c2a151 100644
--- a/src/Helper/Navigation/Menu.php
+++ b/src/Helper/Navigation/Menu.php
@@ -133,16 +133,16 @@ protected function renderDeepestMenu(
$addClassToListItem,
$liActiveClass
) {
- if (!$active = $this->findActive($container, $minDepth - 1, $maxDepth)) {
+ if (! $active = $this->findActive($container, $minDepth - 1, $maxDepth)) {
return '';
}
// special case if active page is one below minDepth
if ($active['depth'] < $minDepth) {
- if (!$active['page']->hasPages(!$this->renderInvisible)) {
+ if (! $active['page']->hasPages(! $this->renderInvisible)) {
return '';
}
- } elseif (!$active['page']->hasPages(!$this->renderInvisible)) {
+ } elseif (! $active['page']->hasPages(! $this->renderInvisible)) {
// found pages has no children; render siblings
$active['page'] = $active['page']->getParent();
} elseif (is_int($maxDepth) && $active['depth'] + 1 > $maxDepth) {
@@ -156,7 +156,7 @@ protected function renderDeepestMenu(
$html = $indent . '
' . PHP_EOL;
foreach ($active['page'] as $subPage) {
- if (!$this->accept($subPage)) {
+ if (! $this->accept($subPage)) {
continue;
}
@@ -205,7 +205,7 @@ public function renderMenu($container = null, array $options = [])
}
$options = $this->normalizeOptions($options);
- if ($options['onlyActiveBranch'] && !$options['renderParents']) {
+ if ($options['onlyActiveBranch'] && ! $options['renderParents']) {
return $this->renderDeepestMenu(
$container,
$options['ulClass'],
@@ -286,10 +286,10 @@ protected function renderNormalMenu(
foreach ($iterator as $page) {
$depth = $iterator->getDepth();
$isActive = $page->isActive(true);
- if ($depth < $minDepth || !$this->accept($page)) {
+ if ($depth < $minDepth || ! $this->accept($page)) {
// page is below minDepth or not accepted by acl/visibility
continue;
- } elseif ($onlyActive && !$isActive) {
+ } elseif ($onlyActive && ! $isActive) {
// page is not active itself, but might be in the active branch
$accept = false;
if ($foundPage) {
@@ -298,7 +298,7 @@ protected function renderNormalMenu(
$accept = true;
} elseif ($foundPage->getParent()->hasPage($page)) {
// page is a sibling of the active page...
- if (!$foundPage->hasPages(!$this->renderInvisible)
+ if (! $foundPage->hasPages(! $this->renderInvisible)
|| is_int($maxDepth) && $foundDepth + 1 > $maxDepth
) {
// accept if active page has no children, or the
@@ -307,7 +307,7 @@ protected function renderNormalMenu(
}
}
}
- if (!$accept) {
+ if (! $accept) {
continue;
}
}
@@ -317,7 +317,7 @@ protected function renderNormalMenu(
$myIndent = $indent.str_repeat(' ', $depth);
if ($depth > $prevDepth) {
// start new ul tag
- if ($ulClass && $depth == 0) {
+ if ($ulClass && $depth == 0) {
$ulClass = ' class="' . $escaper($ulClass) . '"';
} else {
$ulClass = '';
@@ -550,19 +550,19 @@ protected function normalizeOptions(array $options = [])
$options['maxDepth'] = $this->getMaxDepth();
}
- if (!isset($options['onlyActiveBranch'])) {
+ if (! isset($options['onlyActiveBranch'])) {
$options['onlyActiveBranch'] = $this->getOnlyActiveBranch();
}
- if (!isset($options['escapeLabels'])) {
+ if (! isset($options['escapeLabels'])) {
$options['escapeLabels'] = $this->escapeLabels;
}
- if (!isset($options['renderParents'])) {
+ if (! isset($options['renderParents'])) {
$options['renderParents'] = $this->getRenderParents();
}
- if (!isset($options['addClassToListItem'])) {
+ if (! isset($options['addClassToListItem'])) {
$options['addClassToListItem'] = $this->getAddClassToListItem();
}
diff --git a/src/Helper/Navigation/Sitemap.php b/src/Helper/Navigation/Sitemap.php
index 2324a990..76acb227 100644
--- a/src/Helper/Navigation/Sitemap.php
+++ b/src/Helper/Navigation/Sitemap.php
@@ -165,19 +165,19 @@ public function getDomSitemap(AbstractContainer $container = null)
$iterator->setMaxDepth($maxDepth);
}
$minDepth = $this->getMinDepth();
- if (!is_int($minDepth) || $minDepth < 0) {
+ if (! is_int($minDepth) || $minDepth < 0) {
$minDepth = 0;
}
// iterate container
foreach ($iterator as $page) {
- if ($iterator->getDepth() < $minDepth || !$this->accept($page)) {
+ if ($iterator->getDepth() < $minDepth || ! $this->accept($page)) {
// page should not be included
continue;
}
// get absolute url from page
- if (!$url = $this->url($page)) {
+ if (! $url = $this->url($page)) {
// skip page if it has no url (rare case)
// or already is in the sitemap
continue;
@@ -188,7 +188,7 @@ public function getDomSitemap(AbstractContainer $container = null)
$urlSet->appendChild($urlNode);
if ($this->getUseSitemapValidators()
- && !$locValidator->isValid($url)
+ && ! $locValidator->isValid($url)
) {
throw new Exception\RuntimeException(sprintf(
'Encountered an invalid URL for Sitemap XML: "%s"',
@@ -208,7 +208,7 @@ public function getDomSitemap(AbstractContainer $container = null)
$lastmod = date('c', $lastmod);
}
- if (!$this->getUseSitemapValidators()
+ if (! $this->getUseSitemapValidators()
|| $lastmodValidator->isValid($lastmod)
) {
// Cast $lastmod to string in case no validation was used
@@ -221,7 +221,7 @@ public function getDomSitemap(AbstractContainer $container = null)
// add 'changefreq' element if a valid changefreq is set in page
if (isset($page->changefreq)) {
$changefreq = $page->changefreq;
- if (!$this->getUseSitemapValidators() ||
+ if (! $this->getUseSitemapValidators() ||
$changefreqValidator->isValid($changefreq)) {
$urlNode->appendChild(
$dom->createElementNS(self::SITEMAP_NS, 'changefreq', $changefreq)
@@ -232,7 +232,7 @@ public function getDomSitemap(AbstractContainer $container = null)
// add 'priority' element if a valid priority is set in page
if (isset($page->priority)) {
$priority = $page->priority;
- if (!$this->getUseSitemapValidators() ||
+ if (! $this->getUseSitemapValidators() ||
$priorityValidator->isValid($priority)) {
$urlNode->appendChild(
$dom->createElementNS(self::SITEMAP_NS, 'priority', $priority)
@@ -246,7 +246,7 @@ public function getDomSitemap(AbstractContainer $container = null)
ErrorHandler::start();
$test = $dom->schemaValidate(self::SITEMAP_XSD);
$error = ErrorHandler::stop();
- if (!$test) {
+ if (! $test) {
throw new Exception\RuntimeException(sprintf(
'Sitemap is invalid according to XML Schema at "%s"',
self::SITEMAP_XSD
@@ -267,7 +267,7 @@ public function url(AbstractPage $page)
{
$href = $page->getHref();
- if (!isset($href{0})) {
+ if (! isset($href{0})) {
// no href
return '';
} elseif ($href{0} == '/') {
@@ -363,7 +363,7 @@ public function setServerUrl($serverUrl)
*/
public function getServerUrl()
{
- if (!isset($this->serverUrl)) {
+ if (! isset($this->serverUrl)) {
$serverUrlHelper = $this->getView()->plugin('serverUrl');
$this->serverUrl = $serverUrlHelper();
}
diff --git a/src/Helper/Placeholder.php b/src/Helper/Placeholder.php
index 6c046f56..aad16d4c 100644
--- a/src/Helper/Placeholder.php
+++ b/src/Helper/Placeholder.php
@@ -94,7 +94,7 @@ public function getContainer($key)
public function containerExists($key)
{
$key = (string) $key;
- $return = array_key_exists($key, $this->items);
+ $return = array_key_exists($key, $this->items);
return $return;
}
}
diff --git a/src/Helper/Placeholder/Container/AbstractStandalone.php b/src/Helper/Placeholder/Container/AbstractStandalone.php
index 55789634..563b0082 100644
--- a/src/Helper/Placeholder/Container/AbstractStandalone.php
+++ b/src/Helper/Placeholder/Container/AbstractStandalone.php
@@ -217,7 +217,7 @@ public function setContainer(AbstractContainer $container)
*/
public function getContainer()
{
- if (!$this->container instanceof AbstractContainer) {
+ if (! $this->container instanceof AbstractContainer) {
$this->container = new $this->containerClass();
}
return $this->container;
@@ -248,7 +248,7 @@ public function deleteContainer()
*/
public function setContainerClass($name)
{
- if (!class_exists($name)) {
+ if (! class_exists($name)) {
throw new Exception\DomainException(
sprintf(
'%s expects a valid container class name; received "%s", which did not resolve',
@@ -258,7 +258,7 @@ public function setContainerClass($name)
);
}
- if (!in_array('Zend\View\Helper\Placeholder\Container\AbstractContainer', class_parents($name))) {
+ if (! in_array('Zend\View\Helper\Placeholder\Container\AbstractContainer', class_parents($name))) {
throw new Exception\InvalidArgumentException('Invalid Container class specified');
}
@@ -301,7 +301,7 @@ public function setEscaper(Escaper $escaper)
public function getEscaper($enc = 'UTF-8')
{
$enc = strtolower($enc);
- if (!isset($this->escapers[$enc])) {
+ if (! isset($this->escapers[$enc])) {
$this->setEscaper(new Escaper($enc));
}
diff --git a/src/Helper/Placeholder/Registry.php b/src/Helper/Placeholder/Registry.php
index 6d3389c4..d1d3f6ef 100644
--- a/src/Helper/Placeholder/Registry.php
+++ b/src/Helper/Placeholder/Registry.php
@@ -154,7 +154,7 @@ public function deleteContainer($key)
*/
public function setContainerClass($name)
{
- if (!class_exists($name)) {
+ if (! class_exists($name)) {
throw new Exception\DomainException(
sprintf(
'%s expects a valid registry class name; received "%s", which did not resolve',
@@ -164,7 +164,7 @@ public function setContainerClass($name)
);
}
- if (!in_array('Zend\View\Helper\Placeholder\Container\AbstractContainer', class_parents($name))) {
+ if (! in_array('Zend\View\Helper\Placeholder\Container\AbstractContainer', class_parents($name))) {
throw new Exception\InvalidArgumentException('Invalid Container class specified');
}
diff --git a/src/Helper/RenderChildModel.php b/src/Helper/RenderChildModel.php
index ee6e5ba3..bfcde6fc 100644
--- a/src/Helper/RenderChildModel.php
+++ b/src/Helper/RenderChildModel.php
@@ -59,7 +59,7 @@ public function __invoke($child)
public function render($child)
{
$model = $this->findChild($child);
- if (!$model) {
+ if (! $model) {
return '';
}
@@ -103,7 +103,7 @@ protected function findChild($child)
protected function getCurrent()
{
$helper = $this->getViewModelHelper();
- if (!$helper->hasCurrent()) {
+ if (! $helper->hasCurrent()) {
throw new Exception\RuntimeException(sprintf(
'%s: no view model currently registered in renderer; cannot query for children',
__METHOD__
diff --git a/src/Helper/ServerUrl.php b/src/Helper/ServerUrl.php
index 8a7aaf21..56cb0980 100644
--- a/src/Helper/ServerUrl.php
+++ b/src/Helper/ServerUrl.php
@@ -77,7 +77,7 @@ protected function detectHost()
return;
}
- if (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) {
+ if (isset($_SERVER['HTTP_HOST']) && ! empty($_SERVER['HTTP_HOST'])) {
// Detect if the port is set in SERVER_PORT and included in HTTP_HOST
if (isset($_SERVER['SERVER_PORT'])
&& preg_match('/^(?P.*?):(?P\d+)$/', $_SERVER['HTTP_HOST'], $matches)
@@ -103,7 +103,7 @@ protected function detectHost()
return;
}
- if (!isset($_SERVER['SERVER_NAME']) || !isset($_SERVER['SERVER_PORT'])) {
+ if (! isset($_SERVER['SERVER_NAME']) || ! isset($_SERVER['SERVER_PORT'])) {
return;
}
@@ -170,11 +170,11 @@ protected function isReversedProxy()
*/
protected function setHostFromProxy()
{
- if (!$this->useProxy) {
+ if (! $this->useProxy) {
return false;
}
- if (!isset($_SERVER['HTTP_X_FORWARDED_HOST']) || empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
+ if (! isset($_SERVER['HTTP_X_FORWARDED_HOST']) || empty($_SERVER['HTTP_X_FORWARDED_HOST'])) {
return false;
}
@@ -198,11 +198,11 @@ protected function setHostFromProxy()
*/
protected function setPortFromProxy()
{
- if (!$this->useProxy) {
+ if (! $this->useProxy) {
return false;
}
- if (!isset($_SERVER['HTTP_X_FORWARDED_PORT']) || empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
+ if (! isset($_SERVER['HTTP_X_FORWARDED_PORT']) || empty($_SERVER['HTTP_X_FORWARDED_PORT'])) {
return false;
}
@@ -219,7 +219,7 @@ protected function setPortFromProxy()
*/
protected function setSchemeFromProxy()
{
- if (!$this->useProxy) {
+ if (! $this->useProxy) {
return false;
}
@@ -231,7 +231,7 @@ protected function setSchemeFromProxy()
}
}
- if (!isset($_SERVER['HTTP_X_FORWARDED_PROTO']) || empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
+ if (! isset($_SERVER['HTTP_X_FORWARDED_PROTO']) || empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
return false;
}
diff --git a/src/Helper/Url.php b/src/Helper/Url.php
index d2346811..73d9cfdd 100644
--- a/src/Helper/Url.php
+++ b/src/Helper/Url.php
@@ -77,8 +77,8 @@ public function __invoke($name = null, $params = [], $options = [], $reuseMatche
}
}
- if (!is_array($params)) {
- if (!$params instanceof Traversable) {
+ if (! is_array($params)) {
+ if (! $params instanceof Traversable) {
throw new Exception\InvalidArgumentException(
'Params is expected to be an array or a Traversable object'
);
diff --git a/src/Model/FeedModel.php b/src/Model/FeedModel.php
index 3226e3b8..b6e8902f 100644
--- a/src/Model/FeedModel.php
+++ b/src/Model/FeedModel.php
@@ -43,7 +43,7 @@ public function getFeed()
return $this->feed;
}
- if (!$this->type) {
+ if (! $this->type) {
$options = $this->getOptions();
if (isset($options['feed_type'])) {
$this->type = $options['feed_type'];
diff --git a/src/Model/ViewModel.php b/src/Model/ViewModel.php
index ef73df94..f54c099e 100644
--- a/src/Model/ViewModel.php
+++ b/src/Model/ViewModel.php
@@ -105,7 +105,7 @@ public function __set($name, $value)
*/
public function __get($name)
{
- if (!$this->__isset($name)) {
+ if (! $this->__isset($name)) {
return;
}
@@ -133,7 +133,7 @@ public function __isset($name)
*/
public function __unset($name)
{
- if (!$this->__isset($name)) {
+ if (! $this->__isset($name)) {
return;
}
@@ -181,7 +181,7 @@ public function setOptions($options)
$options = ArrayUtils::iteratorToArray($options);
}
- if (!is_array($options)) {
+ if (! is_array($options)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s: expects an array, or Traversable argument; received "%s"',
__METHOD__,
@@ -256,7 +256,7 @@ public function setVariable($name, $value)
*/
public function setVariables($variables, $overwrite = false)
{
- if (!is_array($variables) && !$variables instanceof Traversable) {
+ if (! is_array($variables) && ! $variables instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'%s: expects an array, or Traversable argument; received "%s"',
__METHOD__,
@@ -265,7 +265,7 @@ public function setVariables($variables, $overwrite = false)
}
if ($overwrite) {
- if (is_object($variables) && !$variables instanceof ArrayAccess) {
+ if (is_object($variables) && ! $variables instanceof ArrayAccess) {
$variables = ArrayUtils::iteratorToArray($variables);
}
diff --git a/src/Renderer/ConsoleRenderer.php b/src/Renderer/ConsoleRenderer.php
index f35eeaed..0fd2ff95 100644
--- a/src/Renderer/ConsoleRenderer.php
+++ b/src/Renderer/ConsoleRenderer.php
@@ -106,7 +106,7 @@ public function getFilterChain()
*/
public function render($model, $values = null)
{
- if (!$model instanceof ModelInterface) {
+ if (! $model instanceof ModelInterface) {
return '';
}
diff --git a/src/Renderer/FeedRenderer.php b/src/Renderer/FeedRenderer.php
index b69237aa..76a0e984 100644
--- a/src/Renderer/FeedRenderer.php
+++ b/src/Renderer/FeedRenderer.php
@@ -70,7 +70,7 @@ public function render($nameOrModel, $values = null)
if ($nameOrModel instanceof Model) {
// Use case 1: View Model provided
// Non-FeedModel: cast to FeedModel
- if (!$nameOrModel instanceof FeedModel) {
+ if (! $nameOrModel instanceof FeedModel) {
$vars = $nameOrModel->getVariables();
$options = $nameOrModel->getOptions();
$type = $this->getFeedType();
@@ -96,7 +96,7 @@ public function render($nameOrModel, $values = null)
// Get feed and type
$feed = $nameOrModel->getFeed();
$type = $nameOrModel->getFeedType();
- if (!$type) {
+ if (! $type) {
$type = $this->getFeedType();
} else {
$this->setFeedType($type);
@@ -116,7 +116,7 @@ public function render($nameOrModel, $values = null)
public function setFeedType($feedType)
{
$feedType = strtolower($feedType);
- if (!in_array($feedType, ['rss', 'atom'])) {
+ if (! in_array($feedType, ['rss', 'atom'])) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string of either "rss" or "atom"',
__METHOD__
diff --git a/src/Renderer/JsonRenderer.php b/src/Renderer/JsonRenderer.php
index dca09bef..947c34f3 100644
--- a/src/Renderer/JsonRenderer.php
+++ b/src/Renderer/JsonRenderer.php
@@ -89,7 +89,7 @@ public function setMergeUnnamedChildren($mergeUnnamedChildren)
public function setJsonpCallback($callback)
{
$callback = (string) $callback;
- if (!empty($callback)) {
+ if (! empty($callback)) {
$this->jsonpCallback = $callback;
}
return $this;
@@ -147,7 +147,7 @@ public function render($nameOrModel, $values = null)
// use case 2: $nameOrModel is populated, $values is not
// Serialize $nameOrModel
if (null === $values) {
- if (!is_object($nameOrModel) || $nameOrModel instanceof JsonSerializable) {
+ if (! is_object($nameOrModel) || $nameOrModel instanceof JsonSerializable) {
$return = Json::encode($nameOrModel);
} elseif ($nameOrModel instanceof Traversable) {
$nameOrModel = ArrayUtils::iteratorToArray($nameOrModel);
@@ -200,14 +200,14 @@ protected function recurseModel(Model $model, $mergeWithVariables = true)
$values = ArrayUtils::iteratorToArray($values);
}
- if (!$model->hasChildren()) {
+ if (! $model->hasChildren()) {
return $values;
}
$mergeChildren = $this->mergeUnnamedChildren();
foreach ($model as $child) {
$captureTo = $child->captureTo();
- if (!$captureTo && !$mergeChildren) {
+ if (! $captureTo && ! $mergeChildren) {
// We don't want to do anything with this child
continue;
}
diff --git a/src/Renderer/PhpRenderer.php b/src/Renderer/PhpRenderer.php
index aac1fcd9..5a2d518e 100644
--- a/src/Renderer/PhpRenderer.php
+++ b/src/Renderer/PhpRenderer.php
@@ -213,7 +213,7 @@ public function resolver($name = null)
*/
public function setVars($variables)
{
- if (!is_array($variables) && !$variables instanceof ArrayAccess) {
+ if (! is_array($variables) && ! $variables instanceof ArrayAccess) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or ArrayAccess object; received "%s"',
(is_object($variables) ? get_class($variables) : gettype($variables))
@@ -221,7 +221,7 @@ public function setVars($variables)
}
// Enforce a Variables container
- if (!$variables instanceof Variables) {
+ if (! $variables instanceof Variables) {
$variablesAsArray = [];
foreach ($variables as $key => $value) {
$variablesAsArray[$key] = $value;
@@ -312,7 +312,7 @@ public function __isset($name)
public function __unset($name)
{
$vars = $this->vars();
- if (!isset($vars[$name])) {
+ if (! isset($vars[$name])) {
return;
}
unset($vars[$name]);
@@ -328,7 +328,7 @@ public function __unset($name)
public function setHelperPluginManager($helpers)
{
if (is_string($helpers)) {
- if (!class_exists($helpers)) {
+ if (! class_exists($helpers)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid helper helpers class provided (%s)',
$helpers
@@ -336,7 +336,7 @@ public function setHelperPluginManager($helpers)
}
$helpers = new $helpers(new ServiceManager());
}
- if (!$helpers instanceof HelperPluginManager) {
+ if (! $helpers instanceof HelperPluginManager) {
throw new Exception\InvalidArgumentException(sprintf(
'Helper helpers must extend Zend\View\HelperPluginManager; got type "%s" instead',
(is_object($helpers) ? get_class($helpers) : gettype($helpers))
@@ -490,7 +490,7 @@ public function render($nameOrModel, $values = null)
while ($this->__template = array_pop($this->__templates)) {
$this->__file = $this->resolver($this->__template);
- if (!$this->__file) {
+ if (! $this->__file) {
throw new Exception\RuntimeException(sprintf(
'%s: Unable to render template "%s"; resolver could not resolve to a file',
__METHOD__,
diff --git a/src/Resolver/TemplateMapResolver.php b/src/Resolver/TemplateMapResolver.php
index 8d489772..4433819d 100644
--- a/src/Resolver/TemplateMapResolver.php
+++ b/src/Resolver/TemplateMapResolver.php
@@ -56,7 +56,7 @@ public function getIterator()
*/
public function setMap($map)
{
- if (!is_array($map) && !$map instanceof Traversable) {
+ if (! is_array($map) && ! $map instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'%s: expects an array or Traversable, received "%s"',
__METHOD__,
@@ -87,7 +87,7 @@ public function add($nameOrMap, $path = null)
return $this;
}
- if (!is_string($nameOrMap)) {
+ if (! is_string($nameOrMap)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s: expects a string, array, or Traversable for the first argument; received "%s"',
__METHOD__,
@@ -115,7 +115,7 @@ public function add($nameOrMap, $path = null)
*/
public function merge($map)
{
- if (!is_array($map) && !$map instanceof Traversable) {
+ if (! is_array($map) && ! $map instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'%s: expects an array or Traversable, received "%s"',
__METHOD__,
@@ -151,7 +151,7 @@ public function has($name)
*/
public function get($name)
{
- if (!$this->has($name)) {
+ if (! $this->has($name)) {
return false;
}
return $this->map[$name];
diff --git a/src/Resolver/TemplatePathStack.php b/src/Resolver/TemplatePathStack.php
index 6a5405a8..be6bd5ed 100644
--- a/src/Resolver/TemplatePathStack.php
+++ b/src/Resolver/TemplatePathStack.php
@@ -67,7 +67,7 @@ public function __construct($options = null)
{
$this->useViewStream = (bool) ini_get('short_open_tag');
if ($this->useViewStream) {
- if (!in_array('zend.view', stream_get_wrappers())) {
+ if (! in_array('zend.view', stream_get_wrappers())) {
stream_wrapper_register('zend.view', 'Zend\View\Stream');
}
}
@@ -87,7 +87,7 @@ public function __construct($options = null)
*/
public function setOptions($options)
{
- if (!is_array($options) && !$options instanceof Traversable) {
+ if (! is_array($options) && ! $options instanceof Traversable) {
throw new Exception\InvalidArgumentException(sprintf(
'Expected array or Traversable object; received "%s"',
(is_object($options) ? get_class($options) : gettype($options))
@@ -197,7 +197,7 @@ public static function normalizePath($path)
*/
public function addPath($path)
{
- if (!is_string($path)) {
+ if (! is_string($path)) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid path provided; must be a string, received %s',
gettype($path)
@@ -292,7 +292,7 @@ public function resolve($name, Renderer $renderer = null)
);
}
- if (!count($this->paths)) {
+ if (! count($this->paths)) {
$this->lastLookupFailure = static::FAILURE_NO_PATHS;
return false;
}
@@ -310,7 +310,7 @@ public function resolve($name, Renderer $renderer = null)
if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') {
// Do not try to expand phar paths (realpath + phars == fail)
$filePath = $path . $name;
- if (!file_exists($filePath)) {
+ if (! file_exists($filePath)) {
break;
}
}
diff --git a/src/Strategy/FeedStrategy.php b/src/Strategy/FeedStrategy.php
index b45fd0e7..42b4841c 100644
--- a/src/Strategy/FeedStrategy.php
+++ b/src/Strategy/FeedStrategy.php
@@ -53,7 +53,7 @@ public function selectRenderer(ViewEvent $e)
{
$model = $e->getModel();
- if (!$model instanceof Model\FeedModel) {
+ if (! $model instanceof Model\FeedModel) {
// no FeedModel present; do nothing
return;
}
@@ -77,7 +77,7 @@ public function injectResponse(ViewEvent $e)
}
$result = $e->getResult();
- if (!is_string($result) && !$result instanceof Feed) {
+ if (! is_string($result) && ! $result instanceof Feed) {
// We don't have a string, and thus, no feed
return;
}
diff --git a/src/Strategy/JsonStrategy.php b/src/Strategy/JsonStrategy.php
index f840c7ed..3568d2d3 100644
--- a/src/Strategy/JsonStrategy.php
+++ b/src/Strategy/JsonStrategy.php
@@ -91,7 +91,7 @@ public function selectRenderer(ViewEvent $e)
{
$model = $e->getModel();
- if (!$model instanceof Model\JsonModel) {
+ if (! $model instanceof Model\JsonModel) {
// no JsonModel; do nothing
return;
}
@@ -115,7 +115,7 @@ public function injectResponse(ViewEvent $e)
}
$result = $e->getResult();
- if (!is_string($result)) {
+ if (! is_string($result)) {
// We don't have a string, and thus, no JSON
return;
}
diff --git a/src/Variables.php b/src/Variables.php
index 199a3e69..719fd1d1 100644
--- a/src/Variables.php
+++ b/src/Variables.php
@@ -105,7 +105,7 @@ public function assign($spec)
$spec = (array) $spec;
}
}
- if (!is_array($spec)) {
+ if (! is_array($spec)) {
throw new Exception\InvalidArgumentException(sprintf(
'assign() expects either an array or an object as an argument; received "%s"',
gettype($spec)
@@ -131,7 +131,7 @@ public function assign($spec)
*/
public function offsetGet($key)
{
- if (!$this->offsetExists($key)) {
+ if (! $this->offsetExists($key)) {
if ($this->isStrict()) {
trigger_error(sprintf(
'View variable "%s" does not exist',
diff --git a/src/View.php b/src/View.php
index 90eca859..45487618 100644
--- a/src/View.php
+++ b/src/View.php
@@ -104,7 +104,7 @@ public function setEventManager(EventManagerInterface $events)
*/
public function getEventManager()
{
- if (!$this->events instanceof EventManagerInterface) {
+ if (! $this->events instanceof EventManagerInterface) {
$this->setEventManager(new EventManager());
}
return $this->events;
@@ -175,7 +175,7 @@ public function render(Model $model)
return ($result instanceof Renderer);
}, $event);
$renderer = $results->last();
- if (!$renderer instanceof Renderer) {
+ if (! $renderer instanceof Renderer) {
throw new Exception\RuntimeException(sprintf(
'%s: no renderer selected!',
__METHOD__
@@ -194,8 +194,8 @@ public function render(Model $model)
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
if ($model->hasChildren()
- && (!$renderer instanceof TreeRendererInterface
- || !$renderer->canRenderTrees())
+ && (! $renderer instanceof TreeRendererInterface
+ || ! $renderer->canRenderTrees())
) {
$this->renderChildren($model);
}
@@ -236,9 +236,9 @@ protected function renderChildren(Model $model)
$result = $this->render($child);
$child->setOption('has_parent', null);
$capture = $child->captureTo();
- if (!empty($capture)) {
+ if (! empty($capture)) {
if ($child->isAppend()) {
- $oldResult=$model->{$capture};
+ $oldResult = $model->{$capture};
$model->setVariable($capture, $oldResult . $result);
} else {
$model->setVariable($capture, $result);
diff --git a/src/ViewEvent.php b/src/ViewEvent.php
index 90f193eb..5b1d135e 100644
--- a/src/ViewEvent.php
+++ b/src/ViewEvent.php
@@ -211,7 +211,7 @@ public function getParams()
public function setParams($params)
{
parent::setParams($params);
- if (!is_array($params) && !$params instanceof ArrayAccess) {
+ if (! is_array($params) && ! $params instanceof ArrayAccess) {
return $this;
}
diff --git a/test/Helper/Aggregate.php b/test/Helper/Aggregate.php
new file mode 100644
index 00000000..ddfa449d
--- /dev/null
+++ b/test/Helper/Aggregate.php
@@ -0,0 +1,16 @@
+ 'bar',
+ 'bar' => 'baz'
+ ];
+
+ public function toArray()
+ {
+ return $this->vars;
+ }
+}
diff --git a/test/Helper/CycleTest.php b/test/Helper/CycleTest.php
index b7f15bb1..e875f2a5 100644
--- a/test/Helper/CycleTest.php
+++ b/test/Helper/CycleTest.php
@@ -122,7 +122,7 @@ public function testTwoCyclesInLoop()
{
$expected = [5,4,2,3];
$expected2 = [7,34,8,6];
- for ($i=0;$i<4;$i++) {
+ for ($i = 0; $i < 4; $i++) {
$this->assertEquals($expected[$i], (string) $this->helper->__invoke($expected)->next());
$this->assertEquals($expected2[$i], (string) $this->helper->__invoke($expected2, 'cycle2')->next());
}
diff --git a/test/Helper/GravatarTest.php b/test/Helper/GravatarTest.php
index 6583f7df..abd98697 100644
--- a/test/Helper/GravatarTest.php
+++ b/test/Helper/GravatarTest.php
@@ -273,7 +273,8 @@ public function testInvalidKeyPassedToSetOptionsMethod()
public function testEmailIsProperlyNormalized()
{
- $this->assertEquals('example@example.com',
+ $this->assertEquals(
+ 'example@example.com',
$this->helper->__invoke('Example@Example.com ')->getEmail()
);
}
diff --git a/test/Helper/HeadMetaTest.php b/test/Helper/HeadMetaTest.php
index 4419e52f..bacf4342 100644
--- a/test/Helper/HeadMetaTest.php
+++ b/test/Helper/HeadMetaTest.php
@@ -314,7 +314,7 @@ public function testSetNameDoesntClobber()
$this->assertEquals(
'' . PHP_EOL . '' . PHP_EOL . '',
$view->plugin('headMeta')->toString()
- );
+ );
}
/**
@@ -332,7 +332,7 @@ public function testSetNameDoesntClobberPart2()
$this->assertEquals(
'' . PHP_EOL . '' . PHP_EOL . '' . PHP_EOL . '',
$view->plugin('headMeta')->toString()
- );
+ );
}
/**
@@ -348,7 +348,7 @@ public function testPlacesMetaTagsInProperOrder()
$this->assertEquals(
'' . PHP_EOL . '',
$view->plugin('headMeta')->toString()
- );
+ );
}
/**
@@ -394,13 +394,15 @@ public function testCharset()
$view->plugin('headMeta')->setCharset('utf-8');
$this->assertEquals(
'',
- $view->plugin('headMeta')->toString());
+ $view->plugin('headMeta')->toString()
+ );
$view->plugin('doctype')->__invoke('XHTML5');
$this->assertEquals(
'',
- $view->plugin('headMeta')->toString());
+ $view->plugin('headMeta')->toString()
+ );
}
/**
@@ -410,9 +412,10 @@ public function testPropertyIsSupportedWithRdfaDoctype()
{
$this->view->doctype('XHTML1_RDFA');
$this->helper->__invoke('foo', 'og:title', 'property');
- $this->assertEquals('',
- $this->helper->toString()
- );
+ $this->assertEquals(
+ '',
+ $this->helper->toString()
+ );
}
/**
@@ -465,9 +468,10 @@ public function testItempropIsSupportedWithHtml5Doctype()
{
$this->view->doctype('HTML5');
$this->helper->__invoke('HeadMeta with Microdata', 'description', 'itemprop');
- $this->assertEquals('',
- $this->helper->toString()
- );
+ $this->assertEquals(
+ '',
+ $this->helper->toString()
+ );
}
/**
diff --git a/test/Helper/HeadTitleTest.php b/test/Helper/HeadTitleTest.php
index 3dd50f51..0af4e3b6 100644
--- a/test/Helper/HeadTitleTest.php
+++ b/test/Helper/HeadTitleTest.php
@@ -165,7 +165,7 @@ public function testCanTranslateTitle()
{
$this->markTestIncomplete('Re-enable after zend-i18n is updated to zend-servicemanager v3');
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
diff --git a/test/Helper/Navigation/BreadcrumbsTest.php b/test/Helper/Navigation/BreadcrumbsTest.php
index ce2d71b5..fa2610d7 100644
--- a/test/Helper/Navigation/BreadcrumbsTest.php
+++ b/test/Helper/Navigation/BreadcrumbsTest.php
@@ -160,7 +160,7 @@ public function testUseAclResourceFromPages()
public function testTranslationUsingZendTranslate()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
@@ -172,7 +172,7 @@ public function testTranslationUsingZendTranslate()
public function testTranslationUsingZendTranslateAndCustomTextDomain()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
@@ -186,7 +186,7 @@ public function testTranslationUsingZendTranslateAndCustomTextDomain()
public function testTranslationUsingZendTranslateAdapter()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
diff --git a/test/Helper/Navigation/LinksTest.php b/test/Helper/Navigation/LinksTest.php
index 787a260f..3c243876 100644
--- a/test/Helper/Navigation/LinksTest.php
+++ b/test/Helper/Navigation/LinksTest.php
@@ -51,7 +51,8 @@ public function setUp()
$this->_doctypeHelper = $this->_helper->getView()->plugin('doctype');
$this->_oldDoctype = $this->_doctypeHelper->getDoctype();
$this->_doctypeHelper->setDoctype(
- \Zend\View\Helper\Doctype::HTML4_LOOSE);
+ \Zend\View\Helper\Doctype::HTML4_LOOSE
+ );
// disable all active pages
foreach ($this->_helper->findAllByActive(true) as $page) {
@@ -484,7 +485,8 @@ public function testAclFiltersAwayPagesFromContainerSearch()
$container = $this->_helper->getContainer();
$iterator = new \RecursiveIteratorIterator(
$container,
- \RecursiveIteratorIterator::SELF_FIRST);
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
foreach ($iterator as $page) {
$page->resource = 'protected';
}
diff --git a/test/Helper/Navigation/MenuTest.php b/test/Helper/Navigation/MenuTest.php
index bcaf8bb6..17030a06 100644
--- a/test/Helper/Navigation/MenuTest.php
+++ b/test/Helper/Navigation/MenuTest.php
@@ -215,7 +215,7 @@ public function testOptionEscapeLabelsAsFalse()
public function testTranslationUsingZendTranslate()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
@@ -228,7 +228,7 @@ public function testTranslationUsingZendTranslate()
public function testTranslationUsingZendTranslateWithTextDomain()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
@@ -242,7 +242,7 @@ public function testTranslationUsingZendTranslateWithTextDomain()
public function testTranslationUsingZendTranslateAdapter()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
diff --git a/test/Helper/Navigation/NavigationTest.php b/test/Helper/Navigation/NavigationTest.php
index 35963341..a4d10aa8 100644
--- a/test/Helper/Navigation/NavigationTest.php
+++ b/test/Helper/Navigation/NavigationTest.php
@@ -190,7 +190,7 @@ public function testDisablingAclInjection()
public function testInjectingTranslator()
{
- if (!extension_loaded('intl')) {
+ if (! extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}
diff --git a/test/Helper/Navigation/SitemapTest.php b/test/Helper/Navigation/SitemapTest.php
index 49633da6..eeb37a89 100644
--- a/test/Helper/Navigation/SitemapTest.php
+++ b/test/Helper/Navigation/SitemapTest.php
@@ -178,8 +178,9 @@ public function testThrowExceptionOnInvalidLoc()
$this->_helper->render($nav);
} catch (View\Exception\ExceptionInterface $e) {
$expected = sprintf(
- 'Encountered an invalid URL for Sitemap XML: "%s"',
- 'http://w.');
+ 'Encountered an invalid URL for Sitemap XML: "%s"',
+ 'http://w.'
+ );
$actual = $e->getMessage();
$this->assertEquals($expected, $actual);
return;
@@ -253,8 +254,9 @@ public function testUseSchemaValidation()
$this->_helper->render($nav);
} catch (View\Exception\ExceptionInterface $e) {
$expected = sprintf(
- 'Sitemap is invalid according to XML Schema at "%s"',
- \Zend\View\Helper\Navigation\Sitemap::SITEMAP_XSD);
+ 'Sitemap is invalid according to XML Schema at "%s"',
+ \Zend\View\Helper\Navigation\Sitemap::SITEMAP_XSD
+ );
$actual = $e->getMessage();
$this->assertEquals($expected, $actual);
return;
diff --git a/test/Helper/PartialTest.php b/test/Helper/PartialTest.php
index 1fa072c0..d4d26c81 100644
--- a/test/Helper/PartialTest.php
+++ b/test/Helper/PartialTest.php
@@ -166,16 +166,3 @@ public function testCanPassViewModelAsSoleArgument()
}
}
}
-
-class Aggregate
-{
- public $vars = [
- 'foo' => 'bar',
- 'bar' => 'baz'
- ];
-
- public function toArray()
- {
- return $this->vars;
- }
-}
diff --git a/test/Helper/Placeholder/ContainerTest.php b/test/Helper/Placeholder/ContainerTest.php
index 6e14a14f..3c0383b8 100644
--- a/test/Helper/Placeholder/ContainerTest.php
+++ b/test/Helper/Placeholder/ContainerTest.php
@@ -389,7 +389,7 @@ public function testToStringWithModifiersAndCollectionReturnsFormattedStringWith
/**
* @return void
*/
- public function test__toStringProxiesToToString()
+ public function testToStringProxiesToToString()
{
$this->container[] = 'foo';
$this->container[] = 'bar';
diff --git a/test/Helper/TestAsset/ArrayTranslator.php b/test/Helper/TestAsset/ArrayTranslator.php
index 58cd5084..74ef0262 100644
--- a/test/Helper/TestAsset/ArrayTranslator.php
+++ b/test/Helper/TestAsset/ArrayTranslator.php
@@ -17,7 +17,7 @@ class ArrayTranslator implements Translator\Loader\FileLoaderInterface
public function load($filename, $locale)
{
- $textDomain = new Translator\TextDomain($this->translations);
+ $textDomain = new Translator\TextDomain($this->translations);
return $textDomain;
}
}
diff --git a/test/Helper/TestAsset/ToArray.php b/test/Helper/TestAsset/ToArray.php
index 1de7e7d4..13f7f8d4 100644
--- a/test/Helper/TestAsset/ToArray.php
+++ b/test/Helper/TestAsset/ToArray.php
@@ -11,7 +11,7 @@
class ToArray
{
- public $array = array();
+ public $array = [];
public function toArray()
{
diff --git a/test/HelperPluginManagerTest.php b/test/HelperPluginManagerTest.php
index 0ac97639..8ccfee6e 100644
--- a/test/HelperPluginManagerTest.php
+++ b/test/HelperPluginManagerTest.php
@@ -111,7 +111,7 @@ public function testDefinesFactoryForIdentityPlugin()
public function testIdentityFactoryCanInjectAuthenticationServiceIfInParentServiceManager()
{
$config = new Config(['invokables' => [
- 'Zend\Authentication\AuthenticationService' => 'Zend\Authentication\AuthenticationService',
+ 'Zend\Authentication\AuthenticationService' => 'Zend\Authentication\AuthenticationService',
]]);
$services = new ServiceManager();
$config->configureServiceManager($services);
@@ -125,7 +125,7 @@ public function testIfHelperIsTranslatorAwareAndMvcTranslatorIsAvailableItWillIn
{
$translator = new MvcTranslator($this->getMock('Zend\I18n\Translator\TranslatorInterface'));
$config = new Config(['services' => [
- 'MvcTranslator' => $translator,
+ 'MvcTranslator' => $translator,
]]);
$services = new ServiceManager();
$config->configureServiceManager($services);
@@ -138,7 +138,7 @@ public function testIfHelperIsTranslatorAwareAndMvcTranslatorIsUnavailableAndTra
{
$translator = new Translator();
$config = new Config(['services' => [
- 'Translator' => $translator,
+ 'Translator' => $translator,
]]);
$services = new ServiceManager();
$config->configureServiceManager($services);
@@ -151,7 +151,7 @@ public function testIfHelperIsTranslatorAwareAndBothMvcTranslatorAndTranslatorAr
{
$translator = new Translator();
$config = new Config(['services' => [
- 'Zend\I18n\Translator\TranslatorInterface' => $translator,
+ 'Zend\I18n\Translator\TranslatorInterface' => $translator,
]]);
$services = new ServiceManager();
$config->configureServiceManager($services);
@@ -196,7 +196,8 @@ public function testCanOverrideAFactoryViaConfigurationPassedToConstructor()
public function testCanUseCallableAsHelper()
{
- $helper = function () {};
+ $helper = function () {
+ };
$helpers = new HelperPluginManager(new ServiceManager());
$config = new Config(
[
diff --git a/test/Model/JsonModelTest.php b/test/Model/JsonModelTest.php
index 53e9f658..d753c4c2 100644
--- a/test/Model/JsonModelTest.php
+++ b/test/Model/JsonModelTest.php
@@ -41,11 +41,11 @@ public function testCanSerializeWithJsonpCallback()
public function testPrettyPrint()
{
$array = [
- 'simple'=>'simple test string',
- 'stringwithjsonchars'=>'\"[1,2]',
- 'complex'=>[
- 'foo'=>'bar',
- 'far'=>'boo'
+ 'simple' => 'simple test string',
+ 'stringwithjsonchars' => '\"[1,2]',
+ 'complex' => [
+ 'foo' => 'bar',
+ 'far' => 'boo'
]
];
$model = new JsonModel($array, ['prettyPrint' => true]);
diff --git a/test/Resolver/TemplatePathStackTest.php b/test/Resolver/TemplatePathStackTest.php
index b2212346..0027f4f6 100644
--- a/test/Resolver/TemplatePathStackTest.php
+++ b/test/Resolver/TemplatePathStackTest.php
@@ -115,7 +115,7 @@ public function testStreamWrapperDisabledByDefault()
public function testMayEnableStreamWrapper()
{
$flag = (bool) ini_get('short_open_tag');
- if (!$flag) {
+ if (! $flag) {
$this->markTestSkipped('Short tags are disabled; cannot test');
}
$this->stack->setUseStreamWrapper(true);
@@ -163,7 +163,7 @@ public function testReturnsFullPathNameWhenAbleToResolveScriptPath()
public function testReturnsPathWithStreamProtocolWhenStreamWrapperEnabled()
{
$flag = (bool) ini_get('short_open_tag');
- if (!$flag) {
+ if (! $flag) {
$this->markTestSkipped('Short tags are disabled; cannot test');
}
$this->stack->setUseStreamWrapper(true)
diff --git a/test/TestAsset/Renderer/VarExportRenderer.php b/test/TestAsset/Renderer/VarExportRenderer.php
index 695c8cc9..3415cb81 100644
--- a/test/TestAsset/Renderer/VarExportRenderer.php
+++ b/test/TestAsset/Renderer/VarExportRenderer.php
@@ -27,7 +27,7 @@ public function setResolver(Resolver $resolver)
public function render($nameOrModel, $values = null)
{
- if (!$nameOrModel instanceof Model) {
+ if (! $nameOrModel instanceof Model) {
return var_export($nameOrModel, true);
}
diff --git a/test/TestAsset/Uninvokable.php b/test/TestAsset/Uninvokable.php
index 1c50fe33..539b64e7 100644
--- a/test/TestAsset/Uninvokable.php
+++ b/test/TestAsset/Uninvokable.php
@@ -12,4 +12,7 @@
use Zend\View\Helper\AbstractHelper as Helper;
class Uninvokable extends Helper
-{ }
+{
+
+
+}
diff --git a/test/ViewTest.php b/test/ViewTest.php
index ff72ed15..ffdcd4c3 100644
--- a/test/ViewTest.php
+++ b/test/ViewTest.php
@@ -115,14 +115,14 @@ public function testChildrenMayInvokeDifferentRenderingStrategiesThanParents()
{
$this->view->addRenderingStrategy(function ($e) {
$model = $e->getModel();
- if (!$model instanceof ViewModel) {
+ if (! $model instanceof ViewModel) {
return;
}
return new TestAsset\Renderer\VarExportRenderer();
});
$this->view->addRenderingStrategy(function ($e) {
$model = $e->getModel();
- if (!$model instanceof JsonModel) {
+ if (! $model instanceof JsonModel) {
return;
}
return new Renderer\JsonRenderer();