@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function setHTML($html) |
145 | 145 | { |
146 | 146 | // strip style definitions, if we use css-class "cleanup" on a style-element |
147 | - $this->html = (string)preg_replace('/<style[^>]+class="cleanup"[^>]*>.*<\/style>/Usi', ' ', $html); |
|
147 | + $this->html = (string) preg_replace('/<style[^>]+class="cleanup"[^>]*>.*<\/style>/Usi', ' ', $html); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function setCSS($css) |
156 | 156 | { |
157 | - $this->css = (string)$css; |
|
157 | + $this->css = (string) $css; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | public function convert($outputXHTML = false, $libXMLOptions = 0, $path = false) |
196 | 196 | { |
197 | 197 | // redefine |
198 | - $outputXHTML = (bool)$outputXHTML; |
|
198 | + $outputXHTML = (bool) $outputXHTML; |
|
199 | 199 | |
200 | 200 | // validate |
201 | 201 | if (!$this->html) { |
@@ -306,12 +306,12 @@ discard block |
||
306 | 306 | $cssRules = array(); |
307 | 307 | |
308 | 308 | // init vars |
309 | - $css = (string)$css; |
|
309 | + $css = (string) $css; |
|
310 | 310 | |
311 | 311 | $css = $this->doCleanup($css); |
312 | 312 | |
313 | 313 | // rules are splitted by } |
314 | - $rules = (array)explode('}', $css); |
|
314 | + $rules = (array) explode('}', $css); |
|
315 | 315 | |
316 | 316 | // init var |
317 | 317 | $i = 1; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $cssProperties = trim($chunks[1]); |
334 | 334 | |
335 | 335 | // split multiple selectors |
336 | - $selectors = (array)explode(',', $selectors); |
|
336 | + $selectors = (array) explode(',', $selectors); |
|
337 | 337 | |
338 | 338 | // loop selectors |
339 | 339 | foreach ($selectors as $selector) { |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $css = $this->stripeMediaQueries($css); |
403 | 403 | } |
404 | 404 | |
405 | - return (string)$css; |
|
405 | + return (string) $css; |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | /** |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | // remove comments previously to matching media queries |
418 | 418 | $css = preg_replace(self::$styleCommentRegEx, '', $css); |
419 | 419 | |
420 | - return (string)preg_replace(self::$cssMediaQueriesRegEx, '', $css); |
|
420 | + return (string) preg_replace(self::$cssMediaQueriesRegEx, '', $css); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | */ |
430 | 430 | private function stripeCharsetInCss($css) |
431 | 431 | { |
432 | - return (string)preg_replace(self::$cssCharsetRegEx, '', $css); |
|
432 | + return (string) preg_replace(self::$cssCharsetRegEx, '', $css); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | // loop properties |
451 | 451 | foreach ($properties as $property) { |
452 | 452 | // split into chunks |
453 | - $chunks = (array)explode(':', $property, 2); |
|
453 | + $chunks = (array) explode(':', $property, 2); |
|
454 | 454 | |
455 | 455 | // validate |
456 | 456 | if (!isset($chunks[1])) { |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | */ |
489 | 489 | private function splitIntoProperties($styles) |
490 | 490 | { |
491 | - $properties = (array)explode(';', $styles); |
|
491 | + $properties = (array) explode(';', $styles); |
|
492 | 492 | $propertiesCount = count($properties); |
493 | 493 | |
494 | 494 | /** @noinspection ForeachInvariantsInspection */ |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | if (null !== $stylesAttribute) { |
688 | 688 | // get value for the styles attribute |
689 | 689 | /** @noinspection PhpUndefinedFieldInspection */ |
690 | - $definedStyles = (string)$stylesAttribute->value; |
|
690 | + $definedStyles = (string) $stylesAttribute->value; |
|
691 | 691 | |
692 | 692 | // split into properties |
693 | 693 | $definedProperties = $this->splitIntoProperties($definedStyles); |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | || |
705 | 705 | false === stripos($properties[$key], '!important') |
706 | 706 | || |
707 | - false !== stripos(implode('', (array)$value), '!important') |
|
707 | + false !== stripos(implode('', (array) $value), '!important') |
|
708 | 708 | ) { |
709 | 709 | $properties[$key] = $value; |
710 | 710 | } |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | |
716 | 716 | // build chunks |
717 | 717 | foreach ($properties as $key => $values) { |
718 | - foreach ((array)$values as $value) { |
|
718 | + foreach ((array) $values as $value) { |
|
719 | 719 | $propertyChunks[] = $key . ': ' . $value . ';'; |
720 | 720 | } |
721 | 721 | } |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | } |
746 | 746 | |
747 | 747 | // split into chunks |
748 | - $chunks = (array)explode(':', trim($property), 2); |
|
748 | + $chunks = (array) explode(':', trim($property), 2); |
|
749 | 749 | |
750 | 750 | // validate |
751 | 751 | if (!isset($chunks[1])) { |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | */ |
812 | 812 | public function setCleanup($on = true) |
813 | 813 | { |
814 | - $this->cleanup = (bool)$on; |
|
814 | + $this->cleanup = (bool) $on; |
|
815 | 815 | } |
816 | 816 | |
817 | 817 | /** |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | */ |
824 | 824 | public function setEncoding($encoding) |
825 | 825 | { |
826 | - $this->encoding = (string)$encoding; |
|
826 | + $this->encoding = (string) $encoding; |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | /** |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | */ |
835 | 835 | public function setUseInlineStylesBlock($on = true) |
836 | 836 | { |
837 | - $this->useInlineStylesBlock = (bool)$on; |
|
837 | + $this->useInlineStylesBlock = (bool) $on; |
|
838 | 838 | } |
839 | 839 | |
840 | 840 | /** |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | */ |
848 | 848 | public function setLoadCSSFromHTML($on = true) |
849 | 849 | { |
850 | - $this->loadCSSFromHTML = (bool)$on; |
|
850 | + $this->loadCSSFromHTML = (bool) $on; |
|
851 | 851 | } |
852 | 852 | |
853 | 853 | /** |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | */ |
859 | 859 | public function setStripOriginalStyleTags($on = true) |
860 | 860 | { |
861 | - $this->stripOriginalStyleTags = (bool)$on; |
|
861 | + $this->stripOriginalStyleTags = (bool) $on; |
|
862 | 862 | } |
863 | 863 | |
864 | 864 | /** |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | */ |
873 | 873 | public function setExcludeMediaQueries($on = true) |
874 | 874 | { |
875 | - $this->excludeMediaQueries = (bool)$on; |
|
875 | + $this->excludeMediaQueries = (bool) $on; |
|
876 | 876 | } |
877 | 877 | |
878 | 878 | /** |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | */ |
883 | 883 | public function setExcludeCssCharset($on = true) |
884 | 884 | { |
885 | - $this->excludeCssCharset = (bool)$on; |
|
885 | + $this->excludeCssCharset = (bool) $on; |
|
886 | 886 | } |
887 | 887 | |
888 | 888 | /** |
@@ -892,7 +892,7 @@ discard block |
||
892 | 892 | */ |
893 | 893 | public function setExcludeConditionalInlineStylesBlock($on = true) |
894 | 894 | { |
895 | - $this->excludeConditionalInlineStylesBlock = (bool)$on; |
|
895 | + $this->excludeConditionalInlineStylesBlock = (bool) $on; |
|
896 | 896 | } |
897 | 897 | |
898 | 898 | } |