Skip to content

Commit d6178d5

Browse files
committed
Add Italian translation for type files (singleton, relative-class-types, iterable, resource, enumerations)
1 parent 4db5da5 commit d6178d5

File tree

5 files changed

+317
-0
lines changed

5 files changed

+317
-0
lines changed

language/types/enumerations.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: f4609f913fe6bf4a8b41328df9366726208b7e33 Maintainer: lacatoire Status: ready -->
3+
<sect1 xml:id="language.types.enumerations">
4+
<title>Enumerazioni</title>
5+
<?phpdoc print-version-for="enumerations"?>
6+
7+
<sect2 xml:id="language.types.enumerations.basics">
8+
<title>Enumerazioni di base</title>
9+
10+
<para>
11+
Le enumerazioni sono un livello restrittivo sopra le classi e le costanti di classe,
12+
pensato per fornire un modo di definire un insieme chiuso di valori possibili per un tipo.
13+
</para>
14+
15+
<informalexample>
16+
<programlisting role="php">
17+
<![CDATA[
18+
<?php
19+
enum Suit
20+
{
21+
case Hearts;
22+
case Diamonds;
23+
case Clubs;
24+
case Spades;
25+
}
26+
27+
function do_stuff(Suit $s)
28+
{
29+
// ...
30+
}
31+
32+
do_stuff(Suit::Spades);
33+
?>
34+
]]>
35+
</programlisting>
36+
</informalexample>
37+
38+
<simpara>
39+
Per una trattazione completa, vedere il
40+
capitolo sulle <link linkend="language.enumerations">Enumerazioni</link>.
41+
</simpara>
42+
43+
</sect2>
44+
45+
<sect2 xml:id="language.types.enumerations.casting">
46+
<title>Cast</title>
47+
48+
<para>
49+
Se un <type>enum</type> viene convertito in un <type>object</type>, non viene
50+
modificato. Se un <type>enum</type> viene convertito in un <type>array</type>,
51+
viene creato un array con una singola chiave <literal>name</literal> (per le enum Pure) o
52+
un array con entrambe le chiavi <literal>name</literal> e <literal>value</literal>
53+
(per le enum Backed). Tutti gli altri tipi di cast produrranno un errore.
54+
</para>
55+
</sect2>
56+
</sect1>
57+
58+
<!-- Keep this comment at the end of the file
59+
Local variables:
60+
mode: sgml
61+
sgml-omittag:t
62+
sgml-shorttag:t
63+
sgml-minimize-attributes:nil
64+
sgml-always-quote-attributes:t
65+
sgml-indent-step:1
66+
sgml-indent-data:t
67+
indent-tabs-mode:nil
68+
sgml-parent-document:nil
69+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
70+
sgml-exposed-tags:nil
71+
sgml-local-catalogs:nil
72+
sgml-local-ecat-files:nil
73+
End:
74+
vim600: syn=xml fen fdm=syntax fdl=2 si
75+
vim: et tw=78 syn=sgml
76+
vi: ts=1 sw=1
77+
-->

language/types/iterable.xml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: e587d0655e426f97b3fcb431453da5030e743b23 Maintainer: lacatoire Status: ready -->
3+
<sect1 xml:id="language.types.iterable">
4+
<title>Iterabili</title>
5+
6+
<para>
7+
<type>Iterable</type> è un alias di tipo incorporato in fase di compilazione per
8+
<!-- Need to improve rendering of free-standing type elements in PhD
9+
<type class="union"><type>array</type><type>Traversable</type></type>.
10+
-->
11+
<literal>array|Traversable</literal>.
12+
Dalla sua introduzione in PHP 7.1.0 e prima di PHP 8.2.0,
13+
<type>iterable</type> era un pseudo-tipo incorporato che fungeva da
14+
alias di tipo sopra menzionato e poteva essere utilizzato come dichiarazione di tipo.
15+
Un tipo iterable può essere utilizzato in &foreach; e con
16+
<command>yield from</command> all'interno di un
17+
<link linkend="language.generators">generatore</link>.
18+
</para>
19+
20+
<note>
21+
<para>
22+
Le funzioni che dichiarano iterable come tipo di ritorno possono anche essere <link
23+
linkend="language.generators">generatori</link>.
24+
25+
<example>
26+
<title>
27+
Esempio di tipo di ritorno iterable di un generatore
28+
</title>
29+
<programlisting role="php">
30+
<![CDATA[
31+
<?php
32+
33+
function gen(): iterable {
34+
yield 1;
35+
yield 2;
36+
yield 3;
37+
}
38+
39+
foreach(gen() as $value) {
40+
echo $value, "\n";
41+
}
42+
?>
43+
]]>
44+
</programlisting>
45+
</example>
46+
</para>
47+
</note>
48+
</sect1>
49+
<!-- Keep this comment at the end of the file
50+
Local variables:
51+
mode: sgml
52+
sgml-omittag:t
53+
sgml-shorttag:t
54+
sgml-minimize-attributes:nil
55+
sgml-always-quote-attributes:t
56+
sgml-indent-step:1
57+
sgml-indent-data:t
58+
indent-tabs-mode:nil
59+
sgml-parent-document:nil
60+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
61+
sgml-exposed-tags:nil
62+
sgml-local-catalogs:nil
63+
sgml-local-ecat-files:nil
64+
End:
65+
vim600: syn=xml fen fdm=syntax fdl=2 si
66+
vim: et tw=78 syn=sgml
67+
vi: ts=1 sw=1
68+
-->
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: 161dde4fe721309398dd324edbf02aec409f127b Maintainer: lacatoire Status: ready -->
3+
<sect1 xml:id="language.types.relative-class-types">
4+
<title>Tipi relativi alle classi</title>
5+
6+
<para>
7+
Queste dichiarazioni di tipo possono essere utilizzate solo all'interno delle classi.
8+
</para>
9+
10+
<sect2 xml:id="language.types.relative-class-types.self">
11+
<title><type>self</type></title>
12+
<para>
13+
Il valore deve essere un'&instanceof; della stessa classe in cui
14+
viene utilizzata la dichiarazione di tipo.
15+
</para>
16+
</sect2>
17+
18+
<sect2 xml:id="language.types.relative-class-types.parent">
19+
<title><type>parent</type></title>
20+
<para>
21+
Il valore deve essere un'&instanceof; di una classe genitore
22+
della classe in cui viene utilizzata la dichiarazione di tipo.
23+
</para>
24+
</sect2>
25+
26+
<sect2 xml:id="language.types.relative-class-types.static">
27+
<title>static</title>
28+
<para>
29+
<type>static</type> è un tipo utilizzabile solo come tipo di ritorno che richiede
30+
che il valore restituito sia un'&instanceof; della stessa classe su cui
31+
il metodo viene chiamato.
32+
Disponibile a partire da PHP 8.0.0.
33+
</para>
34+
</sect2>
35+
36+
</sect1>
37+
<!-- Keep this comment at the end of the file
38+
Local variables:
39+
mode: sgml
40+
sgml-omittag:t
41+
sgml-shorttag:t
42+
sgml-minimize-attributes:nil
43+
sgml-always-quote-attributes:t
44+
sgml-indent-step:1
45+
sgml-indent-data:t
46+
indent-tabs-mode:nil
47+
sgml-parent-document:nil
48+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
49+
sgml-exposed-tags:nil
50+
sgml-local-catalogs:nil
51+
sgml-local-ecat-files:nil
52+
End:
53+
vim600: syn=xml fen fdm=syntax fdl=2 si
54+
vim: et tw=78 syn=sgml
55+
vi: ts=1 sw=1
56+
-->

language/types/resource.xml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: 95bdd6883b5dde9504701777ba81b3c5f15df52b Maintainer: lacatoire Status: ready -->
3+
<sect1 xml:id="language.types.resource">
4+
<title>Risorse</title>
5+
6+
<para>
7+
Una <type>resource</type> è una variabile speciale, che contiene un riferimento a una
8+
risorsa esterna. Le risorse vengono create e utilizzate da funzioni speciali. Vedere
9+
l'<link linkend="resource">appendice</link> per un elenco di tutte queste
10+
funzioni e i relativi tipi di <type>resource</type>.
11+
</para>
12+
13+
<para>
14+
Vedere anche la funzione <function>get_resource_type</function>.
15+
</para>
16+
17+
<sect2 xml:id="language.types.resource.casting">
18+
<title>Conversione in resource</title>
19+
20+
<para>
21+
Poiché le variabili <type>resource</type> contengono handle speciali verso file aperti,
22+
connessioni a database, aree canvas di immagini e simili, la conversione in una
23+
<type>resource</type> non ha senso.
24+
</para>
25+
</sect2>
26+
27+
<sect2 xml:id="language.types.resource.self-destruct">
28+
<title>Liberare le risorse</title>
29+
30+
<para>
31+
Grazie al sistema di conteggio dei riferimenti che fa parte di Zend Engine,
32+
una <type>resource</type> senza più riferimenti viene rilevata
33+
automaticamente e liberata dal garbage collector. Per questo motivo, è
34+
raramente necessario liberare la memoria manualmente.
35+
</para>
36+
37+
<note>
38+
<simpara>
39+
Le connessioni persistenti al database sono un'eccezione a questa regola. Esse
40+
<emphasis>non</emphasis> vengono distrutte dal garbage collector. Vedere la
41+
sezione sulle <link linkend="features.persistent-connections">connessioni
42+
persistenti</link> per maggiori informazioni.
43+
</simpara>
44+
</note>
45+
46+
</sect2>
47+
</sect1>
48+
49+
<!-- Keep this comment at the end of the file
50+
Local variables:
51+
mode: sgml
52+
sgml-omittag:t
53+
sgml-shorttag:t
54+
sgml-minimize-attributes:nil
55+
sgml-always-quote-attributes:t
56+
sgml-indent-step:1
57+
sgml-indent-data:t
58+
indent-tabs-mode:nil
59+
sgml-parent-document:nil
60+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
61+
sgml-exposed-tags:nil
62+
sgml-local-catalogs:nil
63+
sgml-local-ecat-files:nil
64+
End:
65+
vim600: syn=xml fen fdm=syntax fdl=2 si
66+
vim: et tw=78 syn=sgml
67+
vi: ts=1 sw=1
68+
-->

language/types/singleton.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- EN-Revision: f908fff129bcd8ec1605658e06457cb04e5b2b51 Maintainer: lacatoire Status: ready -->
3+
<sect1 xml:id="language.types.singleton">
4+
<title>Tipi singleton</title>
5+
6+
<para>
7+
I tipi singleton sono quelli che ammettono un solo valore.
8+
PHP supporta due tipi singleton:
9+
<type>false</type> a partire da PHP 8.0.0 e <type>true</type>
10+
a partire da PHP 8.2.0.
11+
</para>
12+
13+
<warning>
14+
<simpara>
15+
Prima di PHP 8.2.0 il tipo <type>false</type>
16+
poteva essere utilizzato solo come parte di un
17+
<link linkend="language.types.type-system.composite.union">tipo union</link>.
18+
</simpara>
19+
</warning>
20+
21+
<note>
22+
<simpara>
23+
Non è possibile definire tipi singleton personalizzati. Si consiglia di utilizzare
24+
un'<link linkend="language.types.enumerations">enumerazione</link> in alternativa.
25+
</simpara>
26+
</note>
27+
28+
</sect1>
29+
<!-- Keep this comment at the end of the file
30+
Local variables:
31+
mode: sgml
32+
sgml-omittag:t
33+
sgml-shorttag:t
34+
sgml-minimize-attributes:nil
35+
sgml-always-quote-attributes:t
36+
sgml-indent-step:1
37+
sgml-indent-data:t
38+
indent-tabs-mode:nil
39+
sgml-parent-document:nil
40+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
41+
sgml-exposed-tags:nil
42+
sgml-local-catalogs:nil
43+
sgml-local-ecat-files:nil
44+
End:
45+
vim600: syn=xml fen fdm=syntax fdl=2 si
46+
vim: et tw=78 syn=sgml
47+
vi: ts=1 sw=1
48+
-->

0 commit comments

Comments
 (0)