1 | <?php |
||
32 | class Configuration |
||
33 | { |
||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | protected static $imgixFluidOptionsTypeMap = [ |
||
38 | 'fluidClass' => TypeUtils::TYPE_STRING, |
||
39 | 'updateOnResize' => TypeUtils::TYPE_BOOLEAN, |
||
40 | 'updateOnResizeDown' => TypeUtils::TYPE_BOOLEAN, |
||
41 | 'updateOnPinchZoom' => TypeUtils::TYPE_BOOLEAN, |
||
42 | 'highDPRAutoScaleQuality' => TypeUtils::TYPE_BOOLEAN, |
||
43 | 'autoInsertCSSBestPractices' => TypeUtils::TYPE_BOOLEAN, |
||
44 | 'fitImgTagToContainerWidth' => TypeUtils::TYPE_BOOLEAN, |
||
45 | 'fitImgTagToContainerHeight' => TypeUtils::TYPE_BOOLEAN, |
||
46 | 'pixelStep' => TypeUtils::TYPE_INTEGER, |
||
47 | 'ignoreDPR' => TypeUtils::TYPE_BOOLEAN, |
||
48 | 'debounce' => TypeUtils::TYPE_INTEGER, |
||
49 | 'lazyLoad' => TypeUtils::TYPE_BOOLEAN, |
||
50 | 'lazyLoadOffsetVertical' => TypeUtils::TYPE_INTEGER, |
||
51 | 'lazyLoadOffsetHorizontal' => TypeUtils::TYPE_INTEGER, |
||
52 | 'throttle' => TypeUtils::TYPE_INTEGER, |
||
53 | 'maxWidth' => TypeUtils::TYPE_INTEGER, |
||
54 | 'maxHeight' => TypeUtils::TYPE_INTEGER, |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private $configuration = array(); |
||
61 | |||
62 | /** |
||
63 | * @var array |
||
64 | */ |
||
65 | private $settings; |
||
66 | |||
67 | /** |
||
68 | * @param ConfigurationManagerInterface $configurationManager |
||
69 | */ |
||
70 | 16 | public function __construct(ConfigurationManagerInterface $configurationManager) |
|
78 | |||
79 | /** |
||
80 | * @return bool |
||
81 | */ |
||
82 | 2 | public function isApiKeyConfigured() |
|
87 | |||
88 | /** |
||
89 | * @return bool |
||
90 | */ |
||
91 | 2 | public function isEnabled() |
|
98 | |||
99 | /** |
||
100 | * @return bool |
||
101 | */ |
||
102 | 2 | public function isFluidEnabled() |
|
109 | |||
110 | /** |
||
111 | * @return bool |
||
112 | */ |
||
113 | 2 | public function isObservationEnabled() |
|
120 | |||
121 | /** |
||
122 | * @return string |
||
123 | */ |
||
124 | 4 | public function getApiKey() |
|
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | 2 | public function getHost() |
|
142 | |||
143 | /** |
||
144 | * @return array |
||
145 | */ |
||
146 | 2 | public function getImgixFluidOptions() |
|
155 | |||
156 | /** |
||
157 | * @return array |
||
158 | */ |
||
159 | 2 | public function getImgixDefaultUrlParameters() |
|
167 | } |
||
168 |