language/predefined/arrayaccess.xml
9eb4a46bba05da229be4c8f7a3cb64702e1a2f95
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<phpdoc:classref xml:id="class.arrayaccess" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
5
4

6
5
<title>The ArrayAccess interface</title>
...
...
@@ -21,19 +20,15 @@
21
20
&reftitle.interfacesynopsis;
22
21

23
22
<!-- {{{ Synopsis -->
24
-
<classsynopsis>
25
-
<ooclass><classname>ArrayAccess</classname></ooclass>
26
-

27
-
<!-- {{{ Class synopsis -->
28
-
<classsynopsisinfo>
29
-
<ooclass>
30
-
<classname>ArrayAccess</classname>
31
-
</ooclass>
32
-
</classsynopsisinfo>
33
-
<!-- }}} -->
23
+
<classsynopsis class="interface">
24
+
<oointerface>
25
+
<interfacename>ArrayAccess</interfacename>
26
+
</oointerface>
34
27

35
28
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
36
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.arrayaccess')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
29
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.arrayaccess')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='ArrayAccess'])">
30
+
<xi:fallback/>
31
+
</xi:include>
37
32
</classsynopsis>
38
33
<!-- }}} -->
39
34

...
...
@@ -46,17 +41,13 @@
46
41
<![CDATA[
47
42
<?php
48
43
class Obj implements ArrayAccess {
49
-
private $container = array();
50
-

51
-
public function __construct() {
52
-
$this->container = array(
53
-
"one" => 1,
54
-
"two" => 2,
55
-
"three" => 3,
56
-
);
57
-
}
44
+
public $container = [
45
+
"one" => 1,
46
+
"two" => 2,
47
+
"three" => 3,
48
+
];
58
49

59
-
public function offsetSet($offset, $value) {
50
+
public function offsetSet($offset, $value): void {
60
51
if (is_null($offset)) {
61
52
$this->container[] = $value;
62
53
} else {
...
...
@@ -64,15 +55,15 @@ class Obj implements ArrayAccess {
64
55
}
65
56
}
66
57

67
-
public function offsetExists($offset) {
58
+
public function offsetExists($offset): bool {
68
59
return isset($this->container[$offset]);
69
60
}
70
61

71
-
public function offsetUnset($offset) {
62
+
public function offsetUnset($offset): void {
72
63
unset($this->container[$offset]);
73
64
}
74
65

75
-
public function offsetGet($offset) {
66
+
public function offsetGet($offset): mixed {
76
67
return isset($this->container[$offset]) ? $this->container[$offset] : null;
77
68
}
78
69
}
...
...
@@ -125,7 +116,6 @@ obj Object
125
116
&language.predefined.arrayaccess.offsetunset;
126
117

127
118
</phpdoc:classref>
128
-

129
119
<!-- Keep this comment at the end of the file
130
120
Local variables:
131
121
mode: sgml
132
122