Skip to content

Commit 8dd96e4

Browse files
[PHP 8.4] 「Deprecatedアトリビュート」の翻訳 (#169)
* 英語版状態 * [PHP 8.4] 「Deprecatedアトリビュート」の翻訳
1 parent c4d0507 commit 8dd96e4

File tree

4 files changed

+299
-1
lines changed

4 files changed

+299
-1
lines changed

language/predefined/attributes.xml

Lines changed: 2 additions & 1 deletion
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: fe11910e25e7eba44959bd347ba946ffc4d56934 Maintainer: mumumu Status: ready -->
3+
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: mumumu Status: ready -->
44
<part xml:id="reserved.attributes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
55
<title>定義済みのアトリビュート</title>
66

@@ -12,6 +12,7 @@
1212

1313
&language.predefined.attributes.attribute;
1414
&language.predefined.attributes.allowdynamicproperties;
15+
&language.predefined.attributes.deprecated;
1516
&language.predefined.attributes.override;
1617
&language.predefined.attributes.returntypewillchange;
1718
&language.predefined.attributes.sensitiveparameter;
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: KentarouTakeda Status: ready -->
4+
<!-- CREDITS: KentarouTakeda -->
5+
<reference xml:id="class.deprecated" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
6+
<title>Deprecated クラス</title>
7+
<titleabbrev>Deprecated</titleabbrev>
8+
9+
<partintro>
10+
11+
<section xml:id="deprecated.intro">
12+
&reftitle.intro;
13+
<simpara>
14+
このアトリビュートは、機能を非推奨としてマークします。
15+
マークされた機能を使用すると、<constant>E_USER_DEPRECATED</constant> エラーが発生します。
16+
</simpara>
17+
</section>
18+
19+
<section xml:id="deprecated.synopsis">
20+
&reftitle.classsynopsis;
21+
22+
<classsynopsis class="class">
23+
<ooclass>
24+
<modifier>final</modifier>
25+
<classname>Deprecated</classname>
26+
</ooclass>
27+
28+
<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
29+
<fieldsynopsis>
30+
<modifier>public</modifier>
31+
<modifier>readonly</modifier>
32+
<type class="union"><type>string</type><type>null</type></type>
33+
<varname linkend="deprecated.props.message">message</varname>
34+
</fieldsynopsis>
35+
<fieldsynopsis>
36+
<modifier>public</modifier>
37+
<modifier>readonly</modifier>
38+
<type class="union"><type>string</type><type>null</type></type>
39+
<varname linkend="deprecated.props.since">since</varname>
40+
</fieldsynopsis>
41+
42+
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
43+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.deprecated')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='Deprecated'])">
44+
<xi:fallback/>
45+
</xi:include>
46+
</classsynopsis>
47+
</section>
48+
49+
<section xml:id="deprecated.props">
50+
&reftitle.properties;
51+
<variablelist>
52+
<varlistentry xml:id="deprecated.props.message">
53+
<term><varname>message</varname></term>
54+
<listitem>
55+
<para>
56+
非推奨となった理由と可能なら代替機能を説明する追加のメッセージ。
57+
発生する非推奨エラーのメッセージに含まれます。
58+
</para>
59+
</listitem>
60+
</varlistentry>
61+
<varlistentry xml:id="deprecated.props.since">
62+
<term><varname>since</varname></term>
63+
<listitem>
64+
<para>
65+
機能がいつから非推奨になったかを示す追加の文字列。
66+
内容は PHP によって検証されず、バージョン番号、日付、
67+
または適切と考えられる他の値を含むことができます。
68+
発生する非推奨エラーのメッセージに含まれます。
69+
</para>
70+
<para>
71+
PHP 自体の機能は、<varname>since</varname> の値として Major.Minor を利用します。
72+
例えば <literal>'8.4'</literal> です。
73+
</para>
74+
</listitem>
75+
</varlistentry>
76+
</variablelist>
77+
</section>
78+
79+
<section>
80+
&reftitle.examples;
81+
<informalexample>
82+
<programlisting role="php">
83+
<![CDATA[
84+
<?php
85+
86+
#[\Deprecated(message: "use safe_replacement() instead", since: "1.5")]
87+
function unsafe_function()
88+
{
89+
echo "This is unsafe", PHP_EOL;
90+
}
91+
92+
unsafe_function();
93+
94+
?>
95+
]]>
96+
</programlisting>
97+
&example.outputs.84.similar;
98+
<screen>
99+
<![CDATA[
100+
Deprecated: Function unsafe_function() is deprecated since 1.5, use safe_replacement() instead in example.php on line 9
101+
This is unsafe
102+
]]>
103+
</screen>
104+
</informalexample>
105+
</section>
106+
107+
<section xml:id="deprecated.seealso">
108+
&reftitle.seealso;
109+
<simplelist>
110+
<member><link linkend="language.attributes">アトリビュートの概要</link></member>
111+
<member><methodname>ReflectionFunctionAbstract::isDeprecated</methodname></member>
112+
<member><methodname>ReflectionClassConstant::isDeprecated</methodname></member>
113+
<member><constant>E_USER_DEPRECATED</constant></member>
114+
</simplelist>
115+
</section>
116+
117+
</partintro>
118+
119+
&language.predefined.attributes.deprecated.construct;
120+
121+
</reference>
122+
<!-- Keep this comment at the end of the file
123+
Local variables:
124+
mode: sgml
125+
sgml-omittag:t
126+
sgml-shorttag:t
127+
sgml-minimize-attributes:nil
128+
sgml-always-quote-attributes:t
129+
sgml-indent-step:1
130+
sgml-indent-data:t
131+
indent-tabs-mode:nil
132+
sgml-parent-document:nil
133+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
134+
sgml-exposed-tags:nil
135+
sgml-local-catalogs:nil
136+
sgml-local-ecat-files:nil
137+
End:
138+
vim600: syn=xml fen fdm=syntax fdl=2 si
139+
vim: et tw=78 syn=sgml
140+
vi: ts=1 sw=1
141+
-->
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: KentarouTakeda Status: ready -->
4+
<!-- CREDITS: KentarouTakeda -->
5+
<refentry xml:id="deprecated.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>Deprecated::__construct</refname>
8+
<refpurpose>新しい Deprecated のインスタンスを作成する</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<constructorsynopsis role="Deprecated">
14+
<modifier>public</modifier> <methodname>Deprecated::__construct</methodname>
15+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>message</parameter><initializer>&null;</initializer></methodparam>
16+
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>since</parameter><initializer>&null;</initializer></methodparam>
17+
</constructorsynopsis>
18+
<simpara>
19+
新しい <classname>Deprecated</classname> のインスタンスを作成します。
20+
</simpara>
21+
</refsect1>
22+
23+
<refsect1 role="parameters">
24+
&reftitle.parameters;
25+
<variablelist>
26+
<varlistentry>
27+
<term><parameter>message</parameter></term>
28+
<listitem>
29+
<para>
30+
<property linkend="deprecated.props.message">message</property> プロパティの値。
31+
</para>
32+
</listitem>
33+
</varlistentry>
34+
<varlistentry>
35+
<term><parameter>since</parameter></term>
36+
<listitem>
37+
<para>
38+
<property linkend="deprecated.props.since">since</property> プロパティの値。
39+
</para>
40+
</listitem>
41+
</varlistentry>
42+
</variablelist>
43+
</refsect1>
44+
</refentry>
45+
<!-- Keep this comment at the end of the file
46+
Local variables:
47+
mode: sgml
48+
sgml-omittag:t
49+
sgml-shorttag:t
50+
sgml-minimize-attributes:nil
51+
sgml-always-quote-attributes:t
52+
sgml-indent-step:1
53+
sgml-indent-data:t
54+
indent-tabs-mode:nil
55+
sgml-parent-document:nil
56+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
57+
sgml-exposed-tags:nil
58+
sgml-local-catalogs:nil
59+
sgml-local-ecat-files:nil
60+
End:
61+
vim600: syn=xml fen fdm=syntax fdl=2 si
62+
vim: et tw=78 syn=sgml
63+
vi: ts=1 sw=1
64+
-->
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<!-- EN-Revision: 7de265dc47277aaf9b3c9f29d9691364aa0350ca Maintainer: KentarouTakeda Status: ready -->
4+
<!-- CREDITS: KentarouTakeda -->
5+
<refentry xml:id="reflectionclassconstant.isdeprecated" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
6+
<refnamediv>
7+
<refname>ReflectionClassConstant::isDeprecated</refname>
8+
<refpurpose>クラス定数が非推奨かどうかを調べる</refpurpose>
9+
</refnamediv>
10+
11+
<refsect1 role="description">
12+
&reftitle.description;
13+
<methodsynopsis role="ReflectionClassConstant">
14+
<modifier>public</modifier> <type>bool</type><methodname>ReflectionClassConstant::isDeprecated</methodname>
15+
<void/>
16+
</methodsynopsis>
17+
<simpara>
18+
クラス定数が非推奨かどうかを調べます。
19+
</simpara>
20+
21+
</refsect1>
22+
23+
<refsect1 role="parameters">
24+
&reftitle.parameters;
25+
&no.function.parameters;
26+
</refsect1>
27+
28+
<refsect1 role="returnvalues">
29+
&reftitle.returnvalues;
30+
<simpara>
31+
クラス定数が非推奨なら &true; を、そうでなければ &false; を返します。
32+
</simpara>
33+
</refsect1>
34+
35+
<refsect1 role="examples">
36+
&reftitle.examples;
37+
<example>
38+
<title>
39+
<methodname>ReflectionClassConstant::isDeprecated</methodname> の例
40+
</title>
41+
<programlisting role="php">
42+
<![CDATA[
43+
<?php
44+
class Basket {
45+
#[\Deprecated(message: 'use Basket::APPLE instead')]
46+
public const APLE = 'apple';
47+
48+
public const APPLE = 'apple';
49+
}
50+
$classConstant = new ReflectionClassConstant('Basket', 'APLE');
51+
var_dump($classConstant->isDeprecated());
52+
?>
53+
]]>
54+
</programlisting>
55+
&example.outputs;
56+
<screen>
57+
<![CDATA[
58+
bool(true)
59+
]]>
60+
</screen>
61+
</example>
62+
</refsect1>
63+
64+
<refsect1 role="seealso">
65+
&reftitle.seealso;
66+
<simplelist>
67+
<member><classname>Deprecated</classname></member>
68+
<member><methodname>ReflectionClassConstant::getDocComment</methodname></member>
69+
</simplelist>
70+
</refsect1>
71+
72+
</refentry>
73+
<!-- Keep this comment at the end of the file
74+
Local variables:
75+
mode: sgml
76+
sgml-omittag:t
77+
sgml-shorttag:t
78+
sgml-minimize-attributes:nil
79+
sgml-always-quote-attributes:t
80+
sgml-indent-step:1
81+
sgml-indent-data:t
82+
indent-tabs-mode:nil
83+
sgml-parent-document:nil
84+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
85+
sgml-exposed-tags:nil
86+
sgml-local-catalogs:nil
87+
sgml-local-ecat-files:nil
88+
End:
89+
vim600: syn=xml fen fdm=syntax fdl=2 si
90+
vim: et tw=78 syn=sgml
91+
vi: ts=1 sw=1
92+
-->

0 commit comments

Comments
 (0)