Spaces:
Runtime error
Runtime error
File size: 10,351 Bytes
af2986e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | <?php
namespace Symfony\Config\Framework;
use Symfony\Component\Config\Loader\ParamConfigurator;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
/**
* This class is automatically generated to help in creating a config.
*/
class AssetMapperConfig
{
private $enabled;
private $paths;
private $excludedPatterns;
private $excludeDotfiles;
private $server;
private $publicPrefix;
private $missingImportMode;
private $extensions;
private $importmapPath;
private $importmapPolyfill;
private $importmapScriptAttributes;
private $vendorDir;
private $provider;
private $_usedProperties = [];
/**
* @default false
* @param ParamConfigurator|bool $value
* @return $this
*/
public function enabled($value): static
{
$this->_usedProperties['enabled'] = true;
$this->enabled = $value;
return $this;
}
/**
* @return $this
*/
public function path(string $namespace, mixed $value): static
{
$this->_usedProperties['paths'] = true;
$this->paths[$namespace] = $value;
return $this;
}
/**
* @param ParamConfigurator|list<ParamConfigurator|mixed> $value
*
* @return $this
*/
public function excludedPatterns(ParamConfigurator|array $value): static
{
$this->_usedProperties['excludedPatterns'] = true;
$this->excludedPatterns = $value;
return $this;
}
/**
* If true, any files starting with "." will be excluded from the asset mapper
* @default true
* @param ParamConfigurator|bool $value
* @return $this
*/
public function excludeDotfiles($value): static
{
$this->_usedProperties['excludeDotfiles'] = true;
$this->excludeDotfiles = $value;
return $this;
}
/**
* If true, a "dev server" will return the assets from the public directory (true in "debug" mode only by default)
* @default true
* @param ParamConfigurator|bool $value
* @return $this
*/
public function server($value): static
{
$this->_usedProperties['server'] = true;
$this->server = $value;
return $this;
}
/**
* The public path where the assets will be written to (and served from when "server" is true)
* @default '/assets/'
* @param ParamConfigurator|mixed $value
* @return $this
*/
public function publicPrefix($value): static
{
$this->_usedProperties['publicPrefix'] = true;
$this->publicPrefix = $value;
return $this;
}
/**
* Behavior if an asset cannot be found when imported from JavaScript or CSS files - e.g. "import './non-existent.js'". "strict" means an exception is thrown, "warn" means a warning is logged, "ignore" means the import is left as-is.
* @default 'warn'
* @param ParamConfigurator|'strict'|'warn'|'ignore' $value
* @return $this
*/
public function missingImportMode($value): static
{
$this->_usedProperties['missingImportMode'] = true;
$this->missingImportMode = $value;
return $this;
}
/**
* @return $this
*/
public function extension(string $extension, mixed $value): static
{
$this->_usedProperties['extensions'] = true;
$this->extensions[$extension] = $value;
return $this;
}
/**
* The path of the importmap.php file.
* @default '%kernel.project_dir%/importmap.php'
* @param ParamConfigurator|mixed $value
* @return $this
*/
public function importmapPath($value): static
{
$this->_usedProperties['importmapPath'] = true;
$this->importmapPath = $value;
return $this;
}
/**
* The importmap name that will be used to load the polyfill. Set to false to disable.
* @default 'es-module-shims'
* @param ParamConfigurator|mixed $value
* @return $this
*/
public function importmapPolyfill($value): static
{
$this->_usedProperties['importmapPolyfill'] = true;
$this->importmapPolyfill = $value;
return $this;
}
/**
* @return $this
*/
public function importmapScriptAttribute(string $key, mixed $value): static
{
$this->_usedProperties['importmapScriptAttributes'] = true;
$this->importmapScriptAttributes[$key] = $value;
return $this;
}
/**
* The directory to store JavaScript vendors.
* @default '%kernel.project_dir%/assets/vendor'
* @param ParamConfigurator|mixed $value
* @return $this
*/
public function vendorDir($value): static
{
$this->_usedProperties['vendorDir'] = true;
$this->vendorDir = $value;
return $this;
}
/**
* @default null
* @param ParamConfigurator|mixed $value
* @deprecated Since symfony/framework-bundle 6.4: Option "provider" at "framework.asset_mapper" is deprecated and does nothing. Remove it.
* @return $this
*/
public function provider($value): static
{
$this->_usedProperties['provider'] = true;
$this->provider = $value;
return $this;
}
public function __construct(array $config = [])
{
if (array_key_exists('enabled', $config)) {
$this->_usedProperties['enabled'] = true;
$this->enabled = $config['enabled'];
unset($config['enabled']);
}
if (array_key_exists('paths', $config)) {
$this->_usedProperties['paths'] = true;
$this->paths = $config['paths'];
unset($config['paths']);
}
if (array_key_exists('excluded_patterns', $config)) {
$this->_usedProperties['excludedPatterns'] = true;
$this->excludedPatterns = $config['excluded_patterns'];
unset($config['excluded_patterns']);
}
if (array_key_exists('exclude_dotfiles', $config)) {
$this->_usedProperties['excludeDotfiles'] = true;
$this->excludeDotfiles = $config['exclude_dotfiles'];
unset($config['exclude_dotfiles']);
}
if (array_key_exists('server', $config)) {
$this->_usedProperties['server'] = true;
$this->server = $config['server'];
unset($config['server']);
}
if (array_key_exists('public_prefix', $config)) {
$this->_usedProperties['publicPrefix'] = true;
$this->publicPrefix = $config['public_prefix'];
unset($config['public_prefix']);
}
if (array_key_exists('missing_import_mode', $config)) {
$this->_usedProperties['missingImportMode'] = true;
$this->missingImportMode = $config['missing_import_mode'];
unset($config['missing_import_mode']);
}
if (array_key_exists('extensions', $config)) {
$this->_usedProperties['extensions'] = true;
$this->extensions = $config['extensions'];
unset($config['extensions']);
}
if (array_key_exists('importmap_path', $config)) {
$this->_usedProperties['importmapPath'] = true;
$this->importmapPath = $config['importmap_path'];
unset($config['importmap_path']);
}
if (array_key_exists('importmap_polyfill', $config)) {
$this->_usedProperties['importmapPolyfill'] = true;
$this->importmapPolyfill = $config['importmap_polyfill'];
unset($config['importmap_polyfill']);
}
if (array_key_exists('importmap_script_attributes', $config)) {
$this->_usedProperties['importmapScriptAttributes'] = true;
$this->importmapScriptAttributes = $config['importmap_script_attributes'];
unset($config['importmap_script_attributes']);
}
if (array_key_exists('vendor_dir', $config)) {
$this->_usedProperties['vendorDir'] = true;
$this->vendorDir = $config['vendor_dir'];
unset($config['vendor_dir']);
}
if (array_key_exists('provider', $config)) {
$this->_usedProperties['provider'] = true;
$this->provider = $config['provider'];
unset($config['provider']);
}
if ($config) {
throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($config)));
}
}
public function toArray(): array
{
$output = [];
if (isset($this->_usedProperties['enabled'])) {
$output['enabled'] = $this->enabled;
}
if (isset($this->_usedProperties['paths'])) {
$output['paths'] = $this->paths;
}
if (isset($this->_usedProperties['excludedPatterns'])) {
$output['excluded_patterns'] = $this->excludedPatterns;
}
if (isset($this->_usedProperties['excludeDotfiles'])) {
$output['exclude_dotfiles'] = $this->excludeDotfiles;
}
if (isset($this->_usedProperties['server'])) {
$output['server'] = $this->server;
}
if (isset($this->_usedProperties['publicPrefix'])) {
$output['public_prefix'] = $this->publicPrefix;
}
if (isset($this->_usedProperties['missingImportMode'])) {
$output['missing_import_mode'] = $this->missingImportMode;
}
if (isset($this->_usedProperties['extensions'])) {
$output['extensions'] = $this->extensions;
}
if (isset($this->_usedProperties['importmapPath'])) {
$output['importmap_path'] = $this->importmapPath;
}
if (isset($this->_usedProperties['importmapPolyfill'])) {
$output['importmap_polyfill'] = $this->importmapPolyfill;
}
if (isset($this->_usedProperties['importmapScriptAttributes'])) {
$output['importmap_script_attributes'] = $this->importmapScriptAttributes;
}
if (isset($this->_usedProperties['vendorDir'])) {
$output['vendor_dir'] = $this->vendorDir;
}
if (isset($this->_usedProperties['provider'])) {
$output['provider'] = $this->provider;
}
return $output;
}
}
|