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

Commit

Permalink
CS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Koopzington committed Nov 15, 2016
1 parent 473340f commit 2114085
Show file tree
Hide file tree
Showing 62 changed files with 264 additions and 248 deletions.
4 changes: 2 additions & 2 deletions src/Helper/AbstractHtmlElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ abstract class AbstractHtmlElement extends AbstractHelper
*/
public function getClosingBracket()
{
if (!$this->closingBracket) {
if (! $this->closingBracket) {
if ($this->isXhtml()) {
$this->closingBracket = ' />';
} else {
Expand Down Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions src/Helper/Cycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Helper/DeclareVars.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/Doctype.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Helper/Escaper/AbstractHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/FlashMessenger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 3 additions & 3 deletions src/Helper/Gravatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Helper/HeadLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function __call($method, $args)
*/
protected function isValid($value)
{
if (!$value instanceof stdClass) {
if (! $value instanceof stdClass) {
return false;
}

Expand All @@ -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'
);
Expand All @@ -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'
);
Expand All @@ -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'
);
Expand All @@ -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'
);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 13 additions & 13 deletions src/Helper/HeadMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) . '" ';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'))
) {
Expand All @@ -336,7 +336,7 @@ protected function isValid($item)
}

// <meta property= ... /> is only supported with doctype RDFa
if (!$this->view->plugin('doctype')->isRdfa()
if (! $this->view->plugin('doctype')->isRdfa()
&& $item->type === 'property'
) {
return false;
Expand All @@ -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()'
);
Expand All @@ -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()'
);
Expand All @@ -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()');
}

Expand All @@ -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()'
);
Expand All @@ -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()');
}

Expand Down
Loading

0 comments on commit 2114085

Please sign in to comment.