Skip to content

Commit c4ab53c

Browse files
committed
PHP 8.4: Document SplObjectStorage::seek()を翻訳
php/doc-en#4048
1 parent cd10721 commit c4ab53c

File tree

3 files changed

+135
-5
lines changed

3 files changed

+135
-5
lines changed

reference/spl/arrayiterator/seek.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 434557c58ba28213b97f39bc7ca1e59dc8f6cae9 Maintainer: takagi Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="arrayiterator.seek" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
@@ -15,7 +15,9 @@
1515
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
1616
</methodsynopsis>
1717

18-
&warn.undocumented.func;
18+
<simpara>
19+
イテレータ内の指定した位置に移動します。
20+
</simpara>
1921
</refsect1>
2022

2123
<refsect1 role="parameters">
@@ -41,6 +43,14 @@
4143
</para>
4244
</refsect1>
4345

46+
<refsect1 role="errors">
47+
&reftitle.errors;
48+
<simpara>
49+
<parameter>offset</parameter> に移動できない場合は、
50+
<classname>OutOfBoundsException</classname> をスローします。
51+
</simpara>
52+
</refsect1>
53+
4454
</refentry>
4555
<!-- Keep this comment at the end of the file
4656
Local variables:

reference/spl/seekableiterator/seek.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: d51166ca16fda8e766849505b84f9306ef443f71 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 434557c58ba28213b97f39bc7ca1e59dc8f6cae9 Maintainer: takagi Status: ready -->
44
<refentry xml:id="seekableiterator.seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
55
<refnamediv>
66
<refname>SeekableIterator::seek</refname>
@@ -44,10 +44,10 @@
4444

4545
<refsect1 role="errors">
4646
&reftitle.errors;
47-
<para>
47+
<simpara>
4848
<parameter>offset</parameter> に移動できない場合、
4949
<classname>OutOfBoundsException</classname> をスローするよう実装しなければなりません。
50-
</para>
50+
</simpara>
5151
</refsect1>
5252

5353
<refsect1 role="examples">
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: 434557c58ba28213b97f39bc7ca1e59dc8f6cae9 Maintainer: siwa32 Status: ready -->
3+
<!-- CREDITS: siwa32 -->
4+
<refentry xml:id="splobjectstorage.seek" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5+
<refnamediv>
6+
<refname>SplObjectStorage::seek</refname>
7+
<refpurpose>位置を移動する</refpurpose>
8+
</refnamediv>
9+
10+
<refsect1 role="description">
11+
&reftitle.description;
12+
<methodsynopsis role="SplObjectStorage">
13+
<modifier>public</modifier> <type>void</type><methodname>SplObjectStorage::seek</methodname>
14+
<methodparam><type>int</type><parameter>offset</parameter></methodparam>
15+
</methodsynopsis>
16+
17+
<simpara>
18+
イテレータ内の指定した位置に移動します。
19+
</simpara>
20+
</refsect1>
21+
22+
<refsect1 role="parameters">
23+
&reftitle.parameters;
24+
<variablelist>
25+
<varlistentry>
26+
<term><parameter>offset</parameter></term>
27+
<listitem>
28+
<simpara>
29+
移動先の位置。
30+
</simpara>
31+
</listitem>
32+
</varlistentry>
33+
</variablelist>
34+
</refsect1>
35+
36+
<refsect1 role="returnvalues">
37+
&reftitle.returnvalues;
38+
<simpara>
39+
&return.void;
40+
</simpara>
41+
</refsect1>
42+
43+
<refsect1 role="errors">
44+
&reftitle.errors;
45+
<simpara>
46+
<parameter>offset</parameter> に移動できない場合は、
47+
<classname>OutOfBoundsException</classname> をスローします。
48+
</simpara>
49+
</refsect1>
50+
51+
<refsect1 role="examples">
52+
&reftitle.examples;
53+
<example xml:id="splobjectstorage.seek.example.basic">
54+
<title><methodname>SplObjectStorage::seek</methodname> の例</title>
55+
<simpara>
56+
イテレータの 2 番目の位置に移動します。
57+
</simpara>
58+
<programlisting role="php">
59+
<![CDATA[
60+
<?php
61+
class Test {
62+
public function __construct(public string $marker) {}
63+
}
64+
65+
$a = new Test("a");
66+
$b = new Test("b");
67+
$c = new Test("c");
68+
69+
$storage = new SplObjectStorage();
70+
$storage[$a] = "first";
71+
$storage[$b] = "second";
72+
$storage[$c] = "third";
73+
74+
$storage->seek(2);
75+
var_dump($storage->key());
76+
var_dump($storage->current());
77+
?>
78+
]]>
79+
</programlisting>
80+
&example.outputs;
81+
<screen>
82+
<![CDATA[
83+
int(2)
84+
object(Test)#3 (1) {
85+
["marker"]=>
86+
string(1) "c"
87+
}
88+
]]>
89+
</screen>
90+
</example>
91+
</refsect1>
92+
93+
<refsect1 role="seealso">
94+
&reftitle.seealso;
95+
<simplelist>
96+
<member><classname>SeekableIterator</classname></member>
97+
</simplelist>
98+
</refsect1>
99+
100+
</refentry>
101+
<!-- Keep this comment at the end of the file
102+
Local variables:
103+
mode: sgml
104+
sgml-omittag:t
105+
sgml-shorttag:t
106+
sgml-minimize-attributes:nil
107+
sgml-always-quote-attributes:t
108+
sgml-indent-step:1
109+
sgml-indent-data:t
110+
indent-tabs-mode:nil
111+
sgml-parent-document:nil
112+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
113+
sgml-exposed-tags:nil
114+
sgml-local-catalogs:nil
115+
sgml-local-ecat-files:nil
116+
End:
117+
vim600: syn=xml fen fdm=syntax fdl=2 si
118+
vim: et tw=78 syn=sgml
119+
vi: ts=1 sw=1
120+
-->

0 commit comments

Comments
 (0)