Skip to content

Commit

Permalink
Translate Singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan2Shrek committed Jan 27, 2025
1 parent 32c2a96 commit 804941a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
4 changes: 2 additions & 2 deletions language/types.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 5fccbe5195820cd9ec0045674312ec567ef5f6ed Maintainer: yannick Status: ready -->
<!-- EN-Revision: f908fff129bcd8ec1605658e06457cb04e5b2b51 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<!-- CREDITS: DAnnebicque -->
<chapter xml:id="language.types" xmlns="http://docbook.org/ns/docbook">
Expand Down Expand Up @@ -133,7 +133,7 @@ int(16)
&language.types.void;
&language.types.never;
&language.types.relative-class-types;
&language.types.value;
&language.types.singleton;
&language.types.iterable;
&language.types.declarations;
&language.types.type-juggling;
Expand Down
49 changes: 49 additions & 0 deletions language/types/singleton.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: f908fff129bcd8ec1605658e06457cb04e5b2b51 Maintainer: Fan2Shrek Status: ready -->
<!-- Reviewed: yes -->
<sect1 xml:id="language.types.singleton">
<title>Type singleton</title>

<para>
Les types singleton sont ceux qui n'acceptent qu'une seule valeur.
PHP prend en charge deux types singleton :
<type>false</type> depuis PHP 8.0.0 et <type>true</type>
depuis PHP 8.2.0.
</para>

<warning>
<simpara>
Avant PHP 8.2.0, le type <type>false</type> ne pouvait être utilisé
que dans le cadre d'un
<link linkend="language.types.type-system.composite.union">type union</link>.
</simpara>
</warning>

<note>
<simpara>
Il n'est pas possible de définir des types singleton personnalisés. Considérer
l'utilisation d'une <link linkend="language.types.enumerations">énumération</link> à la place.
</simpara>
</note>

</sect1>
<!-- 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
-->

0 comments on commit 804941a

Please sign in to comment.