Skip to content

Commit 74a9ec4

Browse files
committed
Sync with EN
1 parent 2e76370 commit 74a9ec4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+288
-309
lines changed

appendices/reserved.xml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 010542d1dcb9b1d5cd397a77ed580e50de25aca7 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: a63b9c754188b610fe1916404831aa9f1b41efbf Maintainer: sobak Status: ready -->
33
<!-- $Revision$ -->
44

55
<appendix xml:id="reserved" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -143,7 +143,7 @@
143143
<link linkend="control-structures.for">for</link>
144144
</entry>
145145
<entry>
146-
&foreach;
146+
<link linkend="control-structures.foreach">foreach</link>
147147
</entry>
148148
</row>
149149
<row>
@@ -250,7 +250,7 @@
250250
</row>
251251
<row>
252252
<entry>
253-
<link linkend="language.namespaces">use</link>
253+
<link linkend="language.namespaces.importing">use</link>
254254
</entry>
255255
<entry>
256256
<link linkend="language.oop5.properties">var</link>
@@ -288,30 +288,33 @@
288288
<tbody>
289289
<row>
290290
<entry>
291-
<link linkend="language.constants.predefined">__CLASS__</link>
292-
</entry>
293-
<entry>
294-
<link linkend="language.constants.predefined">__DIR__</link>
291+
<link linkend="language.constants.magic">__CLASS__</link>
295292
</entry>
296293
<entry>
297-
<link linkend="language.constants.predefined">__FILE__</link>
294+
<link linkend="language.constants.magic">__DIR__</link>
298295
</entry>
299296
<entry>
300-
<link linkend="language.constants.predefined">__FUNCTION__</link>
297+
<link linkend="language.constants.magic">__FILE__</link>
301298
</entry>
302299
<entry>
303-
<link linkend="language.constants.predefined">__LINE__</link>
300+
<link linkend="language.constants.magic">__FUNCTION__</link>
304301
</entry>
305302
<entry>
306-
<link linkend="language.constants.predefined">__METHOD__</link>
303+
<link linkend="language.constants.magic">__LINE__</link>
307304
</entry>
308305
</row>
309306
<row>
307+
<entry>
308+
<link linkend="language.constants.magic">__METHOD__</link>
309+
</entry>
310+
<entry>
311+
<link linkend="language.constants.magic">__PROPERTY__</link>
312+
</entry>
310313
<entry>
311314
<link linkend="language.namespaces.nsconstants">__NAMESPACE__</link>
312315
</entry>
313316
<entry>
314-
<link linkend="language.constants.predefined">__TRAIT__</link>
317+
<link linkend="language.constants.magic">__TRAIT__</link>
315318
</entry>
316319
<entry>
317320
</entry>

appendices/tokens.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 9418ae19ae6ab1d3f1536db986830362b207b1d6 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: 8147380995947a4c51bc04c266ccd1e87f664700 Maintainer: sobak Status: ready -->
33
<!-- $Revision$ -->
44

55
<appendix xml:id="tokens" xmlns="http://docbook.org/ns/docbook">
@@ -29,10 +29,11 @@
2929
mogą zostać zdefiniowane przez użytkownika (używając dużych liczb jak np. <literal>10000</literal>).
3030
Przy użyciu odpowiedniej strategii to rozwiązanie zadziała z wszystkimi wersjami PHP i wartościami stałych T_*.
3131
<programlisting role="php">
32-
<![CDATA[
32+
<![CDATA[
3333
<?php
3434
// Stała T_FN nie istnieje na wersjach starszych niż PHP 7.4.0
3535
defined('T_FN') || define('T_FN', 10001);
36+
?>
3637
]]>
3738
</programlisting>
3839
</para>

language-defs.ent

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 5097918a78b2d1de0839a48bd30912d498ac5850 Maintainer: joeaccord Status: ready -->
2+
<!-- EN-Revision: a6621a4baf56fd78a842dfd684f5c981991bddcd Maintainer: joeaccord Status: ready -->
33
<!-- $Revision$ -->
44
<!-- CREDITS: leszek, sobak -->
55

@@ -46,7 +46,7 @@
4646
<!ENTITY UIExtensions "Rozszerzenia GUI">
4747
<!ENTITY Appendices "Dodatki">
4848
<!ENTITY PEAR "PEAR: Rozszerzenia PHP i repozytorium aplikacji">
49-
<!ENTITY FAQ "FAQ: Często zadawane pytania">
49+
<!ENTITY FAQ "Często zadawane pytania">
5050
<!ENTITY FAQabbrev "FAQ">
5151
<!ENTITY Internals "PHP i struktura wewnętrzna Zend Engine">
5252
<!ENTITY Internals2 "Rdzeń PHP: Poradnik hackerów o Zend Engine">

language/exceptions.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 844190217fcb8ad1d0790ef5a90f7c18fa9d1a9d Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: 402a72776804fbb74ec5c4cad72d4c7b6cdd5b2d Maintainer: sobak Status: ready -->
33
<!-- $Revision$ -->
44
<chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook">
55
<title>Wyjątki</title>
@@ -388,7 +388,7 @@ class Exception implements Throwable
388388
private $trace; // backtrace
389389
private $previous; // poprzedni wyjątek, jeżeli zostały one zagnieżdżone
390390
391-
public function __construct($message = '', $code = 0, Throwable $previous = null);
391+
public function __construct($message = '', $code = 0, ?Throwable $previous = null);
392392
393393
final private function __clone(); // uniemożliwia klonowanie wyjątków
394394
@@ -434,7 +434,7 @@ class Exception implements Throwable
434434
class MojWyjatek extends Exception
435435
{
436436
// Zredefiniuj konstruktor tak, aby wiadomość wyjątku była obowiązkowa
437-
public function __construct($message, $code = 0, Throwable $previous = null) {
437+
public function __construct($message, $code = 0, ?Throwable $previous = null) {
438438
// jakiś kod
439439
440440
// upewnij się, że wszystko jest przypisane poprawnie

language/oop5.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: f9dabdea3f92ea77cf5077020a3e945951fdc9db Maintainer: sobak Status: ready -->
3-
<chapter xml:id="language.oop5" xmlns="http://docbook.org/ns/docbook">
2+
<!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: sobak Status: ready -->
3+
<chapter xml:id="language.oop5" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
44
<title>Klasy i obiekty</title>
55

66
<sect1 xml:id="oop5.intro">

language/oop5/anonymous.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: a058684525563674d49fcfce7ce22d1183ee0a31 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: d6f54016d62904cfd8200604aadd5e3f0d9bad97 Maintainer: sobak Status: ready -->
33
<sect1 xml:id="language.oop5.anonymous" xmlns="http://docbook.org/ns/docbook">
44
<title>Klasy anonimowe</title>
55

@@ -186,9 +186,8 @@ class@anonymous/in/oNi1A0x7f8636ad2021
186186
<programlisting role="php">
187187
<![CDATA[
188188
<?php
189-
190189
// Użycie klasy anonimowej
191-
$util->setLogger(new readonly class('[DEBUG]') {
190+
var_dump(new readonly class('[DEBUG]') {
192191
public function __construct(private string $prefix)
193192
{
194193
}

language/oop5/autoload.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 22583751fbfdaa3eaa41aeb6470d1343f5cb2c78 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: sobak Status: ready -->
33
<sect1 xml:id="language.oop5.autoload" xmlns="http://docbook.org/ns/docbook">
44
<title>Autoloading klas</title>
55
<para>
@@ -44,7 +44,7 @@
4444
i <literal>MojaKlasa2</literal> z plików <filename>MojaKlasa1.php</filename>
4545
and <filename>MojaKlasa2.php</filename>.
4646
</para>
47-
<programlisting role="php">
47+
<programlisting role="php" annotations="interactive">
4848
<![CDATA[
4949
<?php
5050
spl_autoload_register(function ($class_name) {
@@ -90,7 +90,7 @@ Fatal error: Interface 'ITest' not found in ...
9090
Composera. Dołączając ten plik można używać tych paczek bez
9191
żadnych dodatkowych wymagań.
9292
</simpara>
93-
<programlisting role="php">
93+
<programlisting role="php" annotations="interactive">
9494
<![CDATA[
9595
<?php
9696
require __DIR__ . '/vendor/autoload.php';

language/oop5/decon.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 376d3f9c2ef7fcd64d8b8503d552013acefb8b5b Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: sobak Status: ready -->
33
<sect1 xml:id="language.oop5.decon" xmlns="http://docbook.org/ns/docbook">
44
<title>Konstruktory i destruktory</title>
55

@@ -194,7 +194,7 @@ class Punkt {
194194
</note>
195195
<example>
196196
<title>Użycie new w inicjalizatorach</title>
197-
<programlisting role="php">
197+
<programlisting role="php" annotations="non-interactive">
198198
<![CDATA[
199199
<?php
200200
@@ -237,6 +237,9 @@ function test(
237237
<programlisting role="php">
238238
<![CDATA[
239239
<?php
240+
$jakis_string_json = '{ "id": 1004, "name": "Elephpant" }';
241+
$jakis_string_xml = "<animal><id>1005</id><name>Elephpant</name></animal>";
242+
240243
class Produkt {
241244
242245
private ?int $id;
@@ -258,18 +261,19 @@ class Produkt {
258261
}
259262
260263
public static function fromXml(string $xml): static {
261-
// Dowolna własna logika.
262-
$data = convert_xml_to_array($xml);
264+
$data = simplexml_load_string($xml);
263265
$new = new static();
264-
$new->id = $data['id'];
265-
$new->nazwa = $data['nazwa'];
266+
$new->id = $data->id;
267+
$new->nazwa = $data->nazwa;
266268
return $new;
267269
}
268270
}
269271
270272
$p1 = Produkt::fromBasicData(5, 'Nazwa produktu');
271273
$p2 = Produkt::fromJson($jakis_string_json);
272274
$p3 = Produkt::fromXml($jakis_string_xml);
275+
276+
var_dump($p1, $p2, $p3);
273277
]]>
274278
</programlisting>
275279
</example>

language/operators.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 52407313885d27a4e891e08dd2e2481bcc39e244 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: 16934048f79c6e117cd16a23c09c1b2ea502e284 Maintainer: sobak Status: ready -->
33
<!-- $Revision$ -->
4-
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook">
4+
<chapter xml:id="language.operators" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
55
<title>Operatory</title>
66
<simpara>
77
Operatory to coś, co przyjmuje jedną lub więcej wartości (lub

language/operators/arithmetic.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: c35ad60a7f790d735bbdca01c6baaf65d4867330 Maintainer: sobak Status: ready -->
2+
<!-- EN-Revision: 16934048f79c6e117cd16a23c09c1b2ea502e284 Maintainer: sobak Status: ready -->
33
<sect1 xml:id="language.operators.arithmetic">
44
<title>Operatory arytmetyczne</title>
55
<titleabbrev>Arytmetyczne</titleabbrev>
@@ -81,29 +81,28 @@
8181
Wynik dzielenia modulo <literal>%</literal> ma taki sam znak,
8282
jak dzielna. Oznacza to, że wynik <code>$a % $b</code>
8383
będzie miał taki sam znak jak <varname>$a</varname>. Przykładowo:
84-
<informalexample>
84+
<example>
85+
<title>Operator modulo</title>
8586
<programlisting role="php">
8687
<![CDATA[
8788
<?php
88-
8989
var_dump(5 % 3);
9090
var_dump(5 % -3);
9191
var_dump(-5 % 3);
9292
var_dump(-5 % -3);
93-
9493
?>
9594
]]>
9695
</programlisting>
9796
&example.outputs;
9897
<screen>
99-
<![CDATA[
98+
<![CDATA[
10099
int(2)
101100
int(2)
102101
int(-2)
103102
int(-2)
104103
]]>
105104
</screen>
106-
</informalexample>
105+
</example>
107106
</para>
108107
<sect2 role="seealso">
109108
&reftitle.seealso;

0 commit comments

Comments
 (0)