From 89b0cebce7445dcd14fef9217d1305552cc495e5 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Fri, 21 Jun 2019 19:58:40 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- src/beforeStrip.php | 12 ++++++------ src/prepareStrip.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/beforeStrip.php b/src/beforeStrip.php index 269aac7..7f6b9bc 100644 --- a/src/beforeStrip.php +++ b/src/beforeStrip.php @@ -17,17 +17,17 @@ public function __construct($html) if (!is_string($html)) { throw new \InvalidArgumentException(sprintf('Waiting string, %s given', gettype($html))); } - $html=is_file($html)?file_get_contents($html):$html; + $html=is_file($html) ?file_get_contents($html) : $html; $this->setMainTags($html); $html='
'.str_replace( - array($this->doctype,$this->html_tag,'',$this->head,'',$this->body,''), - array('doctype, 10),'html_tag, 5),'','head, 5),'','body, 5),''), + array($this->doctype, $this->html_tag, '', $this->head, '', $this->body, ''), + array('doctype, 10), 'html_tag, 5), '', 'head, 5), '', 'body, 5), ''), $html ).'
'; $preprocessed=token_get_all($html); - $HTML=array_filter($preprocessed, function ($v) { + $HTML=array_filter($preprocessed, function($v) { return is_array($v)&&$v[0]===T_INLINE_HTML; }); $PHP=array_diff_key($preprocessed, $HTML); @@ -59,8 +59,8 @@ protected function setMainTags(&$html) } protected function init(&$HTML, &$PHP, &$html) { - list($is_h, $is_p)=array((bool)$HTML,(bool)$PHP); - list($this->is_html, $this->is_php, $this->multi, $this->content, $this->html, $this->php)=array($is_h,$is_p,$is_h&&$is_p,$html,$is_p?$HTML:array(),$is_p?$PHP:array()); + list($is_h, $is_p)=array((bool)$HTML, (bool)$PHP); + list($this->is_html, $this->is_php, $this->multi, $this->content, $this->html, $this->php)=array($is_h, $is_p, $is_h&&$is_p, $html, $is_p ? $HTML : array(), $is_p ? $PHP : array()); } public function mustLoadMulti() diff --git a/src/prepareStrip.php b/src/prepareStrip.php index fc0f75b..cc607a6 100644 --- a/src/prepareStrip.php +++ b/src/prepareStrip.php @@ -2,7 +2,7 @@ namespace EZAMA{ class prepareStrip { - protected $state ; + protected $state; protected $preprocessed; public function __construct(beforeStrip $prepocessed) { @@ -19,21 +19,21 @@ public function getPrepared() if ($this->state==='single') { return $this->prepocessed->getContent(); } - $prepared=$this->preparePhp() + $this->prepareHtml(); + $prepared=$this->preparePhp()+$this->prepareHtml(); ksort($prepared); return join('', $prepared); } public function prepareHtml() { - return array_map(function ($v) { - return is_array($v)?$v[1]:$v; + return array_map(function($v) { + return is_array($v) ? $v[1] : $v; }, $this->prepocessed->getHTML()); } public function preparePhp() { - return array_map(function ($v) { - return is_array($v)&&($v[0]===T_OPEN_TAG||$v[0]===T_CLOSE_TAG)?($v[0]===T_OPEN_TAG?'':''):(is_array($v)?$v[1]:$v); + return array_map(function($v) { + return is_array($v)&&($v[0]===T_OPEN_TAG||$v[0]===T_CLOSE_TAG) ? ($v[0]===T_OPEN_TAG ? '' : '') : (is_array($v) ? $v[1] : $v); }, $this->prepocessed->getPHP()); } }