Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP 8.4] 「Deprecatedアトリビュート」の翻訳 #169

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion language/predefined/attributes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: fe11910e25e7eba44959bd347ba946ffc4d56934 Maintainer: mumumu Status: ready -->
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: mumumu Status: ready -->
<part xml:id="reserved.attributes" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>定義済みのアトリビュート</title>

Expand All @@ -12,6 +12,7 @@

&language.predefined.attributes.attribute;
&language.predefined.attributes.allowdynamicproperties;
&language.predefined.attributes.deprecated;
&language.predefined.attributes.override;
&language.predefined.attributes.returntypewillchange;
&language.predefined.attributes.sensitiveparameter;
Expand Down
141 changes: 141 additions & 0 deletions language/predefined/attributes/deprecated.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: KentarouTakeda Status: ready -->
<!-- CREDITS: KentarouTakeda -->
<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">
<title>Deprecated クラス</title>
<titleabbrev>Deprecated</titleabbrev>

<partintro>

<section xml:id="deprecated.intro">
&reftitle.intro;
<simpara>
このアトリビュートは、機能を非推奨としてマークします。
マークされた機能を使用すると、<constant>E_USER_DEPRECATED</constant> エラーが発生します。
</simpara>
</section>

<section xml:id="deprecated.synopsis">
&reftitle.classsynopsis;

<classsynopsis class="class">
<ooclass>
<modifier>final</modifier>
<classname>Deprecated</classname>
</ooclass>

<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>readonly</modifier>
<type class="union"><type>string</type><type>null</type></type>
<varname linkend="deprecated.props.message">message</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<modifier>readonly</modifier>
<type class="union"><type>string</type><type>null</type></type>
<varname linkend="deprecated.props.since">since</varname>
</fieldsynopsis>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<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'])">
<xi:fallback/>
</xi:include>
</classsynopsis>
</section>

<section xml:id="deprecated.props">
&reftitle.properties;
<variablelist>
<varlistentry xml:id="deprecated.props.message">
<term><varname>message</varname></term>
<listitem>
<para>
非推奨となった理由と可能なら代替機能を説明する追加のメッセージ。
発生する非推奨エラーのメッセージに含まれます。
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="deprecated.props.since">
<term><varname>since</varname></term>
<listitem>
<para>
機能がいつから非推奨になったかを示す追加の文字列。
内容は PHP によって検証されず、バージョン番号、日付、
または適切と考えられる他の値を含むことができます。
発生する非推奨エラーのメッセージに含まれます。
</para>
<para>
PHP 自体の機能は、<varname>since</varname> の値として Major.Minor を利用します。
例えば <literal>'8.4'</literal> です。
</para>
</listitem>
</varlistentry>
</variablelist>
</section>

<section>
&reftitle.examples;
<informalexample>
<programlisting role="php">
<![CDATA[
<?php

#[\Deprecated(message: "use safe_replacement() instead", since: "1.5")]
function unsafe_function()
{
echo "This is unsafe", PHP_EOL;
}

unsafe_function();

?>
]]>
</programlisting>
&example.outputs.84.similar;
<screen>
<![CDATA[
Deprecated: Function unsafe_function() is deprecated since 1.5, use safe_replacement() instead in example.php on line 9
This is unsafe
]]>
</screen>
</informalexample>
</section>

<section xml:id="deprecated.seealso">
&reftitle.seealso;
<simplelist>
<member><link linkend="language.attributes">アトリビュートの概要</link></member>
<member><methodname>ReflectionFunctionAbstract::isDeprecated</methodname></member>
<member><methodname>ReflectionClassConstant::isDeprecated</methodname></member>
<member><constant>E_USER_DEPRECATED</constant></member>
</simplelist>
</section>

</partintro>

&language.predefined.attributes.deprecated.construct;

</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
64 changes: 64 additions & 0 deletions language/predefined/attributes/deprecated/construct.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: e890e4a7f97a9ea85e60a38443e7c8eb7ae9383f Maintainer: KentarouTakeda Status: ready -->
<!-- CREDITS: KentarouTakeda -->
<refentry xml:id="deprecated.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Deprecated::__construct</refname>
<refpurpose>新しい Deprecated のインスタンスを作成する</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<constructorsynopsis role="Deprecated">
<modifier>public</modifier> <methodname>Deprecated::__construct</methodname>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>message</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>since</parameter><initializer>&null;</initializer></methodparam>
</constructorsynopsis>
<simpara>
新しい <classname>Deprecated</classname> のインスタンスを作成します。
</simpara>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>message</parameter></term>
<listitem>
<para>
<property linkend="deprecated.props.message">message</property> プロパティの値。
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>since</parameter></term>
<listitem>
<para>
<property linkend="deprecated.props.since">since</property> プロパティの値。
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
92 changes: 92 additions & 0 deletions reference/reflection/reflectionclassconstant/isdeprecated.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 7de265dc47277aaf9b3c9f29d9691364aa0350ca Maintainer: KentarouTakeda Status: ready -->
<!-- CREDITS: KentarouTakeda -->
<refentry xml:id="reflectionclassconstant.isdeprecated" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionClassConstant::isDeprecated</refname>
<refpurpose>クラス定数が非推奨かどうかを調べる</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="ReflectionClassConstant">
<modifier>public</modifier> <type>bool</type><methodname>ReflectionClassConstant::isDeprecated</methodname>
<void/>
</methodsynopsis>
<simpara>
クラス定数が非推奨かどうかを調べます。
</simpara>

</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<simpara>
クラス定数が非推奨なら &true; を、そうでなければ &false; を返します。
</simpara>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<example>
<title>
<methodname>ReflectionClassConstant::isDeprecated</methodname> の例
</title>
<programlisting role="php">
<![CDATA[
<?php
class Basket {
#[\Deprecated(message: 'use Basket::APPLE instead')]
public const APLE = 'apple';

public const APPLE = 'apple';
}
$classConstant = new ReflectionClassConstant('Basket', 'APLE');
var_dump($classConstant->isDeprecated());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(true)
]]>
</screen>
</example>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><classname>Deprecated</classname></member>
<member><methodname>ReflectionClassConstant::getDocComment</methodname></member>
</simplelist>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->