-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathXmlEncoderOptions.php
More file actions
40 lines (37 loc) · 1.5 KB
/
Copy pathXmlEncoderOptions.php
File metadata and controls
40 lines (37 loc) · 1.5 KB
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
<?php
/*
* part of the katmore/micro-encode project
*
* Copyright (c) 2012-2026 Doug Bird. All Rights Reserved.
*/
declare(strict_types=1);
namespace MicroEncode;
/**
* Options for {@see XmlEncoder}.
*
* @author D. Bird <retran@gmail.com>
*/
final class XmlEncoderOptions
{
/**
* @param string $rootNode root node element name
* @param string $defaultNode node element name to use when one cannot be determined from the data itself
* @param int $indentSize indentation size
* @param bool $dumpOk whether to generate a special data-dump node for data that cannot be reliably serialized
* @param string[] $checksumAlgos each array element value specifies a hash algo used to produce a data checksum with
* @param bool $generateStructure whether to generate a node describing the data structure
* @param bool $xsiTypeDetect whether to describe data node types using an extended XSI specification
* @param bool $generateCreatedAttr whether to generate a "fx:created" attribute with the current timestamp
*/
public function __construct(
public readonly string $rootNode = 'fx:data',
public readonly string $defaultNode = 'fx:data',
public readonly int $indentSize = 3,
public readonly bool $dumpOk = false,
public readonly array $checksumAlgos = ['md5'],
public readonly bool $generateStructure = false,
public readonly bool $xsiTypeDetect = true,
public readonly bool $generateCreatedAttr = false,
) {
}
}