From 802f5135b0979bab3bf30ae1733f9867e2caed7a Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Fri, 17 Apr 2020 19:01:05 +0200 Subject: apply psr12 --- app/class/Quickcss.php | 51 ++++++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'app/class/Quickcss.php') diff --git a/app/class/Quickcss.php b/app/class/Quickcss.php index b55a57b..bddea66 100644 --- a/app/class/Quickcss.php +++ b/app/class/Quickcss.php @@ -14,11 +14,22 @@ class Quickcss extends Item private $quickcss = []; - const COLOR = ['color', 'background-color', 'border-color', 'text-decoration-color']; - const SIZE = ['width', 'height', 'margin', 'padding', 'border-radius', 'border-width', 'left', 'right', 'top', 'bottom']; - const UNIQUE = ['background-image', 'opacity', 'font-size']; + public const COLOR = ['color', 'background-color', 'border-color', 'text-decoration-color']; + public const SIZE = [ + 'width', + 'height', + 'margin', + 'padding', + 'border-radius', + 'border-width', + 'left', + 'right', + 'top', + 'bottom' + ]; + public const UNIQUE = ['background-image', 'opacity', 'font-size']; - const OPTIONS = [ + public const OPTIONS = [ 'text-align' => ['left', 'right', 'center', 'justify'], 'border-style' => ['solid', 'double', 'outset', 'ridge'], 'font-family' => ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy'], @@ -35,18 +46,18 @@ class Quickcss extends Item private static function getparams() { $params = array_merge(self::COLOR, self::SIZE, self::getselect(), self::UNIQUE); - sort($params, SORT_STRING ); + sort($params, SORT_STRING); return $params; } public function __construct($data) { - $this->hydrate($data); + $this->hydrate($data); } public function calc() { - $quickcss = $this->intersect($this->values,$this->active); + $quickcss = $this->intersect($this->values, $this->active); $quickcss = $this->merge($quickcss, $this->new); $quickcss = $this->addunits($quickcss, $this->units); $quickcss = $this->merge($this->jsoncss, $quickcss); @@ -60,21 +71,21 @@ class Quickcss extends Item public function setvalues($data) { - if(is_array($data)) { + if (is_array($data)) { $this->values = $data; } } public function setunits($data) { - if(is_array($data)) { + if (is_array($data)) { $this->units = $data; } } public function setactive($data) { - if(is_array($data)) { + if (is_array($data)) { $this->active = $data; } } @@ -90,9 +101,9 @@ class Quickcss extends Item public function setjson($jsoncss) { - if(!empty($jsoncss) && is_string($jsoncss)) { + if (!empty($jsoncss) && is_string($jsoncss)) { $jsoncss = json_decode($jsoncss); - if(is_array($jsoncss)) { + if (is_array($jsoncss)) { $this->jsoncss = $jsoncss; } else { $this->jsoncss = []; @@ -165,7 +176,6 @@ class Quickcss extends Item $this->inputs($this->quickcss); echo '
'; echo ''; - } public function inputs($quickcss) @@ -175,7 +185,7 @@ class Quickcss extends Item echo ''; echo ''; foreach (array_keys($quickcss) as $element) { - echo ''; @@ -188,7 +198,6 @@ class Quickcss extends Item foreach ($quickcss as $element => $css) { echo '

' . $element . '

'; foreach ($css as $param => $value) { - echo '
'; echo ''; echo ''; @@ -218,8 +227,6 @@ class Quickcss extends Item echo '
'; } } - - } @@ -240,7 +247,6 @@ class Quickcss extends Item >em '; foreach (self::OPTIONS[$param] as $option) { - if($option == $value) { - echo ''; + if ($option == $value) { + echo ''; } else { - echo ''; + echo ''; } } echo ''; } - - } -- cgit v1.2.3