-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP 8.4] 「Deprecatedアトリビュート」の翻訳 (#169)
* 英語版状態 * [PHP 8.4] 「Deprecatedアトリビュート」の翻訳
- Loading branch information
1 parent
c4d0507
commit 8dd96e4
Showing
4 changed files
with
299 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
92
reference/reflection/reflectionclassconstant/isdeprecated.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--> |