PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / atomic-widgets / css-converter / conversion-context.php

conversion-context.php in Elementor Website Builder – more than just a page builder 4.2.0, at modules/atomic-widgets/css-converter/conversion-context.php

69 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\AtomicWidgets\CssConverter;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Conversion_Context {
10 private array $props = [];
11
12 private array $rejected = [];
13
14 private array $rules;
15
16 private array $global_variables;
17
18 /**
19 * @param array<int, array{property: string, value: string}> $rules The full set of sibling declarations.
20 * @param array $global_variables Wired for forward compatibility, empty in v1.
21 */
22 public function __construct( array $rules = [], array $global_variables = [] ) {
23 $this->rules = $rules;
24 $this->global_variables = $global_variables;
25 }
26
27 /**
28 * @return array<int, array{property: string, value: string}>
29 */
30 public function get_rules(): array {
31 return $this->rules;
32 }
33
34 public function get_global_variables(): array {
35 return $this->global_variables;
36 }
37
38 public function get_props(): array {
39 return $this->props;
40 }
41
42 public function has_prop( string $property ): bool {
43 return array_key_exists( $property, $this->props );
44 }
45
46 /**
47 * @return mixed
48 */
49 public function get_prop( string $property ) {
50 return $this->props[ $property ] ?? null;
51 }
52
53 /**
54 * @param string $property The output property name the converter owns.
55 * @param mixed $value The canonical PropValue contributed for the property.
56 */
57 public function set_prop( string $property, $value ): void {
58 $this->props[ $property ] = $value;
59 }
60
61 public function reject( string $declaration ): void {
62 $this->rejected[] = $declaration;
63 }
64
65 public function get_rejected(): array {
66 return $this->rejected;
67 }
68 }
69