File tree Expand file tree Collapse file tree 5 files changed +37
-31
lines changed Expand file tree Collapse file tree 5 files changed +37
-31
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
## [ Unreleased] ( https://github.com/inspirum/xml-php/compare/v2.0.0...master )
10
10
11
11
12
+ ## [ v2.1.0 (2022-07-04)] ( https://github.com/inspirum/xml-php/compare/v2.0.0...v2.1.0 )
13
+ ### Added
14
+ - Implement ` \Arrayable ` interface
15
+
16
+
12
17
## [ v2.0.0 (2022-05-21)] ( https://github.com/inspirum/xml-php/compare/v1.0.1...v2.0.0 )
13
18
### Changed
14
19
- Support only ** PHP 8.1+**
@@ -25,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
25
30
- Factories for [ XML builder] ( ./src/Builder/Document.php ) and [ XML Reader] ( ./src/Reader/Reader.php )
26
31
- Publicly available [ ` Formatter::nodeToArray ` ] ( ./src/Formatter/Formatter.php ) method
27
32
33
+
28
34
## [ v1.0.1 (2020-01-18)] ( https://github.com/inspirum/xml-php/compare/v1.0.0...v1.0.1 )
29
35
### Fixed
30
36
- Support "_ " in elements name
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " inspirum/xml" ,
3
- "description" : " " ,
3
+ "description" : " Simple XML writer and memory efficient XML reader with powerful xml-to-array cast " ,
4
4
"keywords" : [
5
5
" inspirum" ,
6
6
" xml" ,
7
7
" xml-reader" ,
8
+ " xml-parser" ,
8
9
" xml-writer" ,
9
- " xml-parser"
10
+ " xml-builder" ,
11
+ " xml-to-array"
10
12
],
11
13
"homepage" : " https://github.com/inspirum/xml-php" ,
12
14
"license" : " MIT" ,
22
24
"php" : " >=8.1" ,
23
25
"ext-dom" : " *" ,
24
26
"ext-json" : " *" ,
25
- "ext-xmlreader" : " *"
27
+ "ext-xmlreader" : " *" ,
28
+ "inspirum/arrayable" : " ^1.0"
26
29
},
27
30
"require-dev" : {
28
- "inspirum/coding-standard" : " ^1.0 " ,
29
- "phpstan/phpstan" : " ^1.6 " ,
31
+ "inspirum/coding-standard" : " ^1.1 " ,
32
+ "phpstan/phpstan" : " ^1.8 " ,
30
33
"phpunit/phpunit" : " ^9.5" ,
31
- "squizlabs/php_codesniffer" : " ^3.6 "
34
+ "squizlabs/php_codesniffer" : " ^3.7 "
32
35
},
33
36
"autoload" : {
34
37
"psr-4" : {
35
38
"Inspirum\\ XML\\ " : " src"
36
39
}
37
40
},
41
+ "minimum-stability" : " dev" ,
42
+ "prefer-stable" : true ,
38
43
"autoload-dev" : {
39
44
"psr-4" : {
40
45
"Inspirum\\ XML\\ Tests\\ " : " tests"
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd" backupGlobals =" false" colors =" true" bootstrap =" vendor/autoload.php" convertDeprecationsToExceptions =" false" >
3
3
<php >
4
- <ini name =" display_errors" value =" 1" />
5
- <ini name =" error_reporting" value =" -1" />
4
+ <ini name =" display_errors" value =" 1" />
5
+ <ini name =" error_reporting" value =" -1" />
6
6
</php >
7
7
<testsuites >
8
8
<testsuite name =" Unit" >
13
13
<include >
14
14
<directory suffix =" .php" >src</directory >
15
15
</include >
16
- <exclude >
17
- <directory suffix =" Interface.php" >src</directory >
18
- </exclude >
19
16
<report >
20
17
<clover outputFile =" var/phpunit/logs/clover.xml" />
21
18
<text outputFile =" var/phpunit/coverage/coverage.txt" />
Original file line number Diff line number Diff line change @@ -258,7 +258,19 @@ public function toArray(?Config $config = null): array
258
258
}
259
259
260
260
/**
261
- * @inheritDoc
261
+ * Convert to array
262
+ *
263
+ * @return array<int|string,mixed>
264
+ */
265
+ public function __toArray (): array
266
+ {
267
+ return $ this ->toArray ();
268
+ }
269
+
270
+ /**
271
+ * Convert to array
272
+ *
273
+ * @return array<int|string,mixed>
262
274
*/
263
275
public function jsonSerialize (): array
264
276
{
Original file line number Diff line number Diff line change 6
6
7
7
use DOMDocument ;
8
8
use DOMNode ;
9
+ use Inspirum \Arrayable \Arrayable ;
9
10
use Inspirum \XML \Formatter \Config ;
10
11
use JsonSerializable ;
11
12
use Stringable ;
12
13
13
- interface Node extends Stringable, JsonSerializable
14
+ /**
15
+ * @extends \Inspirum\Arrayable\Arrayable<int|string,mixed>
16
+ */
17
+ interface Node extends Arrayable, Stringable, JsonSerializable
14
18
{
15
19
/**
16
20
* Add element to XML node
@@ -74,28 +78,10 @@ public function getNode(): ?DOMNode;
74
78
*/
75
79
public function toString (bool $ formatOutput = false ): string ;
76
80
77
- /**
78
- * Convert to string
79
- *
80
- * @see toString()
81
- *
82
- * @return string
83
- */
84
- public function __toString (): string ;
85
-
86
81
/**
87
82
* Convert to array
88
83
*
89
84
* @return array<int|string,mixed>
90
85
*/
91
86
public function toArray (?Config $ config = null ): array ;
92
-
93
- /**
94
- * Convert to array
95
- *
96
- * @see toArray()
97
- *
98
- * @return array<int|string,mixed>
99
- */
100
- public function jsonSerialize (): array ;
101
87
}
You can’t perform that action at this time.
0 commit comments