| @@ -7,8 +7,10 @@ | ||
| 7 | 7 | * @author Florian Schmitz, Brett Zamir, Nikolay Matsievsky, Cedric Morin, Christopher Finke, Mark Scherer, Tobias Bäthge |
| 8 | 8 | * @since 1.0.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +declare(strict_types=1); | |
| 12 | + | |
| 11 | 13 | // Prohibit direct script loading. |
| 12 | 14 | defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); |
| 13 | 15 | |
| 14 | 16 | /** |
| @@ -24,59 +26,52 @@ | ||
| 24 | 26 | /** |
| 25 | 27 | * TablePress_CSSTidy instance. |
| 26 | 28 | * |
| 27 | 29 | * @since 1.0.0 |
| 28 | - * @var TablePress_CSSTidy | |
| 29 | 30 | */ |
| 30 | - public $parser; | |
| 31 | + public \TablePress_CSSTidy $parser; | |
| 31 | 32 | |
| 32 | 33 | /** |
| 33 | 34 | * The parsed CSS. |
| 34 | 35 | * |
| 35 | 36 | * @since 1.0.0 |
| 36 | - * @var array | |
| 37 | 37 | */ |
| 38 | - public $css = array(); | |
| 38 | + public array $css = array(); | |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * The current sub-value. |
| 42 | 42 | * |
| 43 | 43 | * @since 1.0.0 |
| 44 | - * @var string | |
| 45 | 44 | */ |
| 46 | - public $sub_value = ''; | |
| 45 | + public string $sub_value = ''; | |
| 47 | 46 | |
| 48 | 47 | /** |
| 49 | 48 | * The current at rule (@media). |
| 50 | 49 | * |
| 51 | 50 | * @since 1.0.0 |
| 52 | - * @var string | |
| 53 | 51 | */ |
| 54 | - public $at = ''; | |
| 52 | + public string $at = ''; | |
| 55 | 53 | |
| 56 | 54 | /** |
| 57 | 55 | * The current selector. |
| 58 | 56 | * |
| 59 | 57 | * @since 1.0.0 |
| 60 | - * @var string | |
| 61 | 58 | */ |
| 62 | - public $selector = ''; | |
| 59 | + public string $selector = ''; | |
| 63 | 60 | |
| 64 | 61 | /** |
| 65 | 62 | * The current property. |
| 66 | 63 | * |
| 67 | 64 | * @since 1.0.0 |
| 68 | - * @var string | |
| 69 | 65 | */ |
| 70 | - public $property = ''; | |
| 66 | + public string $property = ''; | |
| 71 | 67 | |
| 72 | 68 | /** |
| 73 | 69 | * The current value. |
| 74 | 70 | * |
| 75 | 71 | * @since 1.0.0 |
| 76 | - * @var string | |
| 77 | 72 | */ |
| 78 | - public $value = ''; | |
| 73 | + public string $value = ''; | |
| 79 | 74 | |
| 80 | 75 | /** |
| 81 | 76 | * Constructor. |
| 82 | 77 | * |
| @@ -83,9 +78,9 @@ | ||
| 83 | 78 | * @since 1.0.0 |
| 84 | 79 | * |
| 85 | 80 | * @param TablePress_CSSTidy $csstidy Instance of the TablePress_CSSTidy class. |
| 86 | 81 | */ |
| 87 | - public function __construct( $csstidy ) { | |
| 82 | + public function __construct( TablePress_CSSTidy $csstidy ) { | |
| 88 | 83 | $this->parser = $csstidy; |
| 89 | 84 | $this->css = &$csstidy->css; |
| 90 | 85 | $this->sub_value = &$csstidy->sub_value; |
| 91 | 86 | $this->at = &$csstidy->at; |
| @@ -521,11 +516,11 @@ | ||
| 521 | 516 | |
| 522 | 517 | $return[0] = (float) $a_string; |
| 523 | 518 | if ( abs( $return[0] ) > 0 && abs( $return[0] ) < 1 ) { |
| 524 | 519 | if ( $return[0] < 0 ) { |
| 525 | - $return[0] = '-' . ltrim( substr( $return[0], 1 ), '0' ); | |
| 520 | + $return[0] = '-' . ltrim( substr( (string) $return[0], 1 ), '0' ); | |
| 526 | 521 | } else { |
| 527 | - $return[0] = ltrim( $return[0], '0' ); | |
| 522 | + $return[0] = ltrim( (string) $return[0], '0' ); | |
| 528 | 523 | } |
| 529 | 524 | } |
| 530 | 525 | |
| 531 | 526 | // Look for unit and split from value if exists. |