forked from php-fig/fig-standards
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/php-fig/fig-standards
- Loading branch information
Showing
21 changed files
with
3,859 additions
and
1,347 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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,48 @@ | ||
PSR-2 Метадокумент | ||
=================== | ||
|
||
1. Обзор | ||
---------- | ||
|
||
Цель данного руководства — уменьшить когнитивное сопротивление при | ||
визуальном восприятии кода, написанного разными авторами. Для этого составлен | ||
список распространённых правил и ожиданий относительно форматирования | ||
PHP-кода. | ||
|
||
Представленные здесь стилистические правила получены на основе обобщения опыта | ||
различных проектов. При сотрудничестве разных авторов над множеством проектов, | ||
полезно применять единый набор руководящих принципов для этих проектов. | ||
Таким образом, польза данного руководства не в правилах, как таковых, | ||
а в их распространённости. | ||
|
||
2. Голосования | ||
-------- | ||
|
||
- **Приёмочное голосование:** [ML](https://groups.google.com/d/msg/php-fig/c-QVvnZdMQ0/TdDMdzKFpdIJ) | ||
|
||
|
||
3. Список исправлений | ||
--------- | ||
|
||
### 3.1 - Многострочные аргументы (08.09.2013) | ||
|
||
Использование одного или нескольких многострочных аргументов (например: массив или анонимная функция) не является разбиением | ||
списка аргументов, и, таким образом не принуждает к применению раздела 4.6. Массивы и анонимные функции могут занимать несколько строк. | ||
|
||
Следующие примеры полностью удовлетовряют PSR-2: | ||
|
||
```php | ||
<?php | ||
somefunction($foo, $bar, [ | ||
// ... | ||
], $baz); | ||
|
||
$app->get('/hello/{name}', function ($name) use ($app) { | ||
return 'Hello '.$app->escape($name); | ||
}); | ||
``` | ||
|
||
### 3.2 - Расширение нескольких интерфейсов (17.10.2013) | ||
|
||
При расширении нескольких интерфейсов, со списком `extends` следует поступать так же как с `implements`, как описано в разделе 4.1. | ||
|
Oops, something went wrong.