-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,160 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: e0e74c05cb704b614ff6925552884fbffb26bb53 Maintainer: Fan2Shrek Status: ready --> | ||
<!-- Reviewed: yes --> | ||
<reference xmlns="http://docbook.org/ns/docbook" xml:id="enum.reflection.propertyhooktype" role="enum"> | ||
<title>L'énumération \PropertyHookType</title> | ||
<titleabbrev>\PropertyHookType</titleabbrev> | ||
|
||
<partintro> | ||
<section xml:id="enum.reflection.propertyhooktype.intro"> | ||
&reftitle.intro; | ||
<simpara> | ||
L'énumération <enumname>\PropertyHookType</enumname> liste les types | ||
légaux de <link linkend="language.oop5.property-hooks">hook de propriété</link>. | ||
</simpara> | ||
</section> | ||
|
||
<section xml:id="enum.reflection.propertyhooktype.synopsis"> | ||
&reftitle.enumsynopsis; | ||
|
||
<enumsynopsis> | ||
<enumname>\PropertyHookType</enumname> | ||
|
||
<enumitem> | ||
<enumidentifier>Get</enumidentifier> | ||
<enumitemdescription> | ||
Indique un hook <literal>get</literal>. | ||
</enumitemdescription> | ||
</enumitem> | ||
|
||
<enumitem> | ||
<enumidentifier>Set</enumidentifier> | ||
<enumitemdescription> | ||
Indique un hook <literal>set</literal>. | ||
</enumitemdescription> | ||
</enumitem> | ||
</enumsynopsis> | ||
</section> | ||
</partintro> | ||
</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,93 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: e0e74c05cb704b614ff6925552884fbffb26bb53 Maintainer: Fan2Shrek Status: ready --> | ||
<!-- Reviewed: yes --> | ||
<refentry xml:id="reflectionproperty.gethook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>ReflectionProperty::getHook</refname> | ||
<refpurpose>Renvoie un objet de réflexion pour un hook donné</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis role="ReflectionProperty"> | ||
<modifier>public</modifier> <type class="union"><type>ReflectionMethod</type><type>null</type></type><methodname>ReflectionProperty::getHook</methodname> | ||
<methodparam><type>PropertyHookType</type><parameter>type</parameter></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Renvoie la réflexion du hook de la propriété, si défini. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>PropertyHookType</parameter></term> | ||
<listitem> | ||
<simpara> | ||
Le type de hook à demander. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
Si le hook demandé est défini, une instance de <classname>ReflectionMethod</classname> sera retournée. | ||
Sinon, la méthode renverra &null; | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example xml:id="reflectionproperty.gethook.example.basic"> | ||
<title>Exemple de <methodname>ReflectionProperty::getHook</methodname></title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
class Example | ||
{ | ||
public string $name { get => "Name here"; } | ||
} | ||
$rClass = new \ReflectionClass(Example::class); | ||
$rProp = $rClass->getProperty('name'); | ||
var_dump($rProp->getHook(PropertyHookType::Get)); | ||
var_dump($rProp->getHook(PropertyHookType::Set)); | ||
?> | ||
]]> | ||
</programlisting> | ||
</example> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><classname>ReflectionMethod</classname></member> | ||
<member><classname>PropertyHookType</classname></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 | ||
--> |
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,93 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: e0e74c05cb704b614ff6925552884fbffb26bb53 Maintainer: Fan2Shrek Status: ready --> | ||
<!-- Reviewed: yes --> | ||
<refentry xml:id="reflectionproperty.gethooks" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>ReflectionProperty::getHooks</refname> | ||
<refpurpose>Renvoie un tableau de tous les hooks sur cette propriété</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis role="ReflectionProperty"> | ||
<modifier>public</modifier> <type>array</type><methodname>ReflectionProperty::getHooks</methodname> | ||
<void/> | ||
</methodsynopsis> | ||
<simpara> | ||
Renvoie une lite de tous les hooks sur cette propriété. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
&no.function.parameters; | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
Un tableau de <classname>ReflectionMethod</classname> objets indexés par le hook auquel ils correspondent. | ||
Par exemple, une propriété avec des hooks <literal>get</literal> et <literal>set</literal> renverra | ||
un tableau à 2 éléments avec des clés de chaîne <literal>get</literal> et <literal>set</literal>, | ||
chacune est un objet <classname>ReflectionMethod</classname>. | ||
L'ordre dans lequel ils sont retournés est explicitement indéfini. | ||
Si aucun hook n'est défini, un tableau vide est retourné. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example xml:id="reflectionproperty.gethooks.example.basic"> | ||
<title>Exemple de <methodname>ReflectionProperty::getHooks</methodname></title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
class Example | ||
{ | ||
public string $name { get => "Name here"; } | ||
public int $count; | ||
} | ||
$rClass = new \ReflectionClass(Example::class); | ||
$rProp = $rClass->getProperty('name'); | ||
var_dump($rProp->getHooks()); | ||
$rProp = $rClass->getProperty('count'); | ||
var_dump($rProp->getHooks()); | ||
?> | ||
]]> | ||
</programlisting> | ||
</example> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><classname>ReflectionMethod</classname></member> | ||
<member><methodname>ReflectionProperty::hasHooks</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 | ||
--> |
110 changes: 110 additions & 0 deletions
110
reference/reflection/reflectionproperty/getrawvalue.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,110 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- EN-Revision: e0e74c05cb704b614ff6925552884fbffb26bb53 Maintainer: Fan2Shrek Status: ready --> | ||
<!-- Reviewed: yes --> | ||
<refentry xml:id="reflectionproperty.getrawvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> | ||
<refnamediv> | ||
<refname>ReflectionProperty::getRawValue</refname> | ||
<refpurpose>Renvoie la valeur de la propriété, en contournant un hook get si défini</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis role="ReflectionProperty"> | ||
<modifier>public</modifier> <type>mixed</type><methodname>ReflectionProperty::getRawValue</methodname> | ||
<methodparam><type>object</type><parameter>object</parameter></methodparam> | ||
</methodsynopsis> | ||
&warn.undocumented.func; | ||
<simpara> | ||
Renvoie la valeur d'une propriété, en contournant un hook <literal>get</literal> si défini. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>object</parameter></term> | ||
<listitem> | ||
<simpara> | ||
L'objet à partir duquel récupérer une valeur. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
La valeur stockée de la propriété, en contournant un hook <literal>get</literal> si défini. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="errors"> | ||
&reftitle.errors; | ||
<simpara> | ||
Si la propriété est virtuelle, une <classname>Error</classname> sera lancée, | ||
car il n'y a pas de valeur brute à récupérer. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="examples"> | ||
&reftitle.examples; | ||
<example xml:id="reflectionproperty.getrawvalue.example.basic"> | ||
<title>Exemple de <methodname>ReflectionProperty::getRawValue</methodname></title> | ||
<programlisting role="php"> | ||
<![CDATA[ | ||
<?php | ||
class Example | ||
{ | ||
public string $tag { | ||
get => strtolower($this->tag); | ||
} | ||
} | ||
$example = new Example(); | ||
$example->tag = 'PHP'; | ||
$rClass = new \ReflectionClass(Example::class); | ||
$rProp = $rClass->getProperty('tag'); | ||
// Ceci passerait par le hook get, produisant donc "php". | ||
print $example->tag; | ||
print $rProp->getValue($example); | ||
// Mais ceci contournerait le hook et produirait "PHP". | ||
print $rProp->setRawValue($example); | ||
?> | ||
]]> | ||
</programlisting> | ||
</example> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><link linkend="language.oop5.visibility-members-aviz">Visibilité de propriété asymétrique</link></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 | ||
--> |
Oops, something went wrong.