Skip to content

Commit a56f1fd

Browse files
committed
Added $context properties.
1 parent d5be65e commit a56f1fd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/Sabre/XML/Reader.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ class Reader extends XMLReader {
2929
*/
3030
public $elementMap = [];
3131

32+
/**
33+
* Context information.
34+
*
35+
* This array has no pre-defined meaning. It can be used by the the user to
36+
* store arbitrary information.
37+
*
38+
* This is handy when a Property class needs access to this data. The only
39+
* direct relation they have back to other objects is the Reader itself.
40+
*
41+
* @var array
42+
*/
43+
public $context = [];
44+
3245
/**
3346
* Returns the current nodename in clark-notation.
3447
*

lib/Sabre/XML/Writer.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ class Writer extends XMLWriter {
4242
*/
4343
public $namespaceMap = [];
4444

45+
/**
46+
* Context information.
47+
*
48+
* This array has no pre-defined meaning. It can be used by the the user to
49+
* store arbitrary information.
50+
*
51+
* This is handy when a Property class needs access to this data. The only
52+
* direct relation they have back to other objects is the Writer itself.
53+
*
54+
* @var array
55+
*/
56+
public $context = [];
57+
4558
/**
4659
* Any namespace that the writer is asked to write, will be added here.
4760
*

0 commit comments

Comments
 (0)