Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/10-basics/10-hello-world/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ print_r('Hexlet - programming school');

The command stays the same, only the content of the parentheses changes. So that the program understands that this is text, it is enclosed in quotes. You can use single `'...'` or double `"..."` quotes, but the opening and closing quotes must match.

```php
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
<?php

print_r('Hexlet - programming school');
print_r("Hexlet - programming school");
```

In PHP, it is customary to use single quotes for strings. If there is an apostrophe inside the string, single quotes will break the syntax, so in such cases double quotes are used.
Expand Down
6 changes: 4 additions & 2 deletions modules/10-basics/10-hello-world/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@

El comando sigue siendo el mismo, solo cambia el contenido de los paréntesis. Para que el programa entienda que se trata de texto, este se encierra entre comillas. Puedes usar comillas simples `'...'` o dobles `"..."`, pero las comillas de apertura y de cierre deben coincidir.

```php
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text

Check notice on line 31 in modules/10-basics/10-hello-world/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/10-basics/10-hello-world/es/README.md#L31

Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN) Suggestions: `an` URL: https://languagetool.org/insights/post/indefinite-articles/ Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US Category: MISC
Raw output
modules/10-basics/10-hello-world/es/README.md:31:6: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
 Suggestions: `an`
 URL: https://languagetool.org/insights/post/indefinite-articles/ 
 Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US
 Category: MISC
<?php

print_r('Hexlet - escuela de programación');
print_r("Hexlet - escuela de programación");
```

En PHP se acostumbra a usar comillas simples para las cadenas. Si dentro de la cadena hay un apóstrofo, las comillas simples romperán la sintaxis, por lo que en esos casos se usan comillas dobles.
Expand Down
6 changes: 4 additions & 2 deletions modules/10-basics/10-hello-world/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ print_r('Хекслет - школа программирования');

Команда остается той же, меняется только содержимое скобок. Чтобы программа понимала, что это именно текст, он заключается в кавычки. Можно использовать одинарные `'...'` или двойные `"..."`, но открывающая и закрывающая кавычки должны совпадать.

```php
<!-- lint-code-blocks: skip — две формы записи кавычек это предмет урока, форматтер свёл бы их к одной -->

```text
<?php

print_r('Хекслет - школа программирования');
print_r("Хекслет - школа программирования");
```

В PHP принято использовать одинарные кавычки для строк. Если внутри строки есть апостроф, одинарные кавычки сломают синтаксис, поэтому в таких случаях используют двойные.
Expand Down
10 changes: 6 additions & 4 deletions modules/20-arithmetics/20-basic/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ From PHP's point of view, there's no difference between `3+4` and `3 + 4`. The i

The variant without spaces also works:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

3 + 4;
8 / 2;
7 % 3;
3+4;
8/2;
7%3;
```

But such code looks less tidy and is harder to perceive quickly. So it's better to get used to writing with spaces around operators right away.
10 changes: 6 additions & 4 deletions modules/20-arithmetics/20-basic/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@

La variante sin espacios también funciona:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

Check notice on line 151 in modules/20-arithmetics/20-basic/es/README.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] modules/20-arithmetics/20-basic/es/README.md#L151

Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN) Suggestions: `an` URL: https://languagetool.org/insights/post/indefinite-articles/ Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US Category: MISC
Raw output
modules/20-arithmetics/20-basic/es/README.md:151:157: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’. (EN_A_VS_AN)
 Suggestions: `an`
 URL: https://languagetool.org/insights/post/indefinite-articles/ 
 Rule: https://community.languagetool.org/rule/show/EN_A_VS_AN?lang=en-US
 Category: MISC

```text
<?php

3 + 4;
8 / 2;
7 % 3;
3+4;
8/2;
7%3;
```

Pero ese código se ve menos prolijo y es más difícil de percibir rápidamente. Por eso es mejor acostumbrarse desde el principio a escribir con espacios alrededor de los operadores.
10 changes: 6 additions & 4 deletions modules/20-arithmetics/20-basic/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,14 @@ print_r(15 % 5); // => 0 (делится без остатка)

Вариант без пробелов тоже работает:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

3 + 4;
8 / 2;
7 % 3;
3+4;
8/2;
7%3;
```

Но такой код выглядит менее аккуратно и его сложнее быстро воспринимать. Поэтому лучше сразу привыкать писать с пробелами вокруг операторов.
6 changes: 4 additions & 2 deletions modules/20-arithmetics/45-linting/en/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
You received some code from a colleague — it works correctly, but it violates the PSR-12 formatting standard. Fix the spaces around the operators without changing the logic:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(5 ** 2 - (3 * 7));
print_r( (5 **2)-(3* 7));
```

The result should remain `4`.
14 changes: 10 additions & 4 deletions modules/20-arithmetics/45-linting/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ In the PHP world, two tools are widely used: [PHP_CodeSniffer](https://github.co

Let's look at an example:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(1 + 3);
print_r(1+ 3);
```

Such code looks sloppy, and the linter will rightly point out the error. Here's what the checking process looks like:
Expand All @@ -55,11 +57,15 @@ print_r(1 + 3);

Each linter message is associated with a specific rule. Suppose we have a file with the following PHP code:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

// On the next line, the indentation is one tab
print_r((8 / 2) + 5 - (-3 / 2));
print_r (((8 / 2) + 5) - (-3 / 2));

?>
```

When checking the file, the linter will find the following errors:
Expand Down
6 changes: 4 additions & 2 deletions modules/20-arithmetics/45-linting/es/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Recibiste código de un colega — funciona correctamente, pero infringe el estándar de formato PSR-12. Corrige los espacios alrededor de los operadores sin cambiar la lógica:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(5 ** 2 - (3 * 7));
print_r( (5 **2)-(3* 7));
```

El resultado debe seguir siendo `4`.
14 changes: 10 additions & 4 deletions modules/20-arithmetics/45-linting/es/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ En el mundo de PHP se utilizan ampliamente dos herramientas: [PHP_CodeSniffer](h

Veamos un ejemplo:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(1 + 3);
print_r(1+ 3);
```

Este código se ve descuidado, y el linter señalará con razón el error. Así es como se ve el proceso de verificación:
Expand All @@ -55,11 +57,15 @@ print_r(1 + 3);

Cada mensaje del linter está relacionado con una regla concreta. Supongamos que tenemos un archivo con el siguiente código PHP:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

// La siguiente línea tiene una sangría de una tabulación
print_r((8 / 2) + 5 - (-3 / 2));
print_r (((8 / 2) + 5) - (-3 / 2));

?>
```

Al verificar el archivo, el linter encontrará los siguientes errores:
Expand Down
6 changes: 4 additions & 2 deletions modules/20-arithmetics/45-linting/ru/EXERCISE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Вы получили код от коллеги — он работает правильно, но нарушает стандарт оформления PSR-12. Исправьте пробелы вокруг операторов, не меняя логику:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(5 ** 2 - (3 * 7));
print_r( (5 **2)-(3* 7));
```

Результат должен остаться `4`.
14 changes: 10 additions & 4 deletions modules/20-arithmetics/45-linting/ru/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@

Рассмотрим пример:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

print_r(1 + 3);
print_r(1+ 3);
```

Такой код выглядит неаккуратно, и линтер справедливо укажет на ошибку. Вот как выглядит процесс проверки:
Expand All @@ -55,11 +57,15 @@ print_r(1 + 3);

Каждое сообщение линтера связано с конкретным правилом. Допустим, у нас есть файл с таким PHP-кодом:

```php
<!-- lint-code-blocks: skip — неаккуратный код это предмет урока, форматтер привёл бы его к стилю -->

```text
<?php

// На следующей строке отступ равен одному табу
print_r((8 / 2) + 5 - (-3 / 2));
print_r (((8 / 2) + 5) - (-3 / 2));

?>
```

При проверке файла линтер найдет следующие ошибки:
Expand Down
Loading