{"action":"created","comment":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/58819376","id":58819376,"diff_hunk":"@@ -0,0 +1,477 @@\n+Стиль кодирования Yii2 framework\n+==============================\n+\n+Описанный ниже стиль кодирования используется при разработке ядра Yii 2.x и его официальных расширений. Если вы хотите участвовать в разработке фреймворка, постарайтесь придерживаться данного стиля. Мы не принуждаем вас использовать этот стиль при разработке ваших приложений с использованием Yii 2. В данном случае можете использовать тот стиль, который вам больше подходит.\n+\n+Пример конфигурационного файла для CodeSniffer вы можете найти здесь: https://github.com/yiisoft/yii2-coding-standards\n+\n+1. Обзор\n+-----------\n+\n+В общем, мы используем совместимый со стандартом [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) стиль, так что все положения [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) вполне применимы к нашему стилю кодирования.\n+\n+- ДОЛЖНЫ использоваться только открывающие теги `<?php` или `<?=`;\n+- В конце файла должна быть пустая строка;\n+- Файлы PHP кодом ДОЛЖНЫ содержать только символы в кодировке UTF-8 без BOM;\n+- Для выравнивания кода НУЖНО использовать 4 пробела вместо табуляции;\n+- Имена классов ДОЛЖНЫ быть объявлены используя `StudlyCaps`;\n+- Константы класса ДОЛЖНЫ быть объявлены в верхнем регистре с подчеркиванием в качестве разделителей;\n+- Имена методов ДОЛЖНЫ быть объявлены используя `camelCase`;\n+- Имена свойств ДОЛЖНЫ быть объявлены используя `camelCase`;\n+- Имена свойств ДОЛЖНЫ начинаться с подчеркивания если они объявлены с использованием модификатора `private`;\n+- Всегда используйте `elseif` вместо `else if`.\n+\n+2. Файлы\n+--------\n+\n+### 2.1. Теги PHP\n+\n+- В PHP коде ДОЛЖНЫ использоваться теги `<?php ?>` или `<?=`; НЕ ДОЛЖНЫ использоваться другие теги, такие как `<?`;\n+- Если файл содержит только PHP код, тогда закрывающий тег `?>` не нужен;\n+- Не добавляйте лишние пробелы в конец строки;\n+- Все файлы, содержащие PHP код, должны иметь расширение `.php`.\n+\n+### 2.2. Кодировка символов\n+\n+PHP код должен содержать только символы в кодировке UTF-8 без BOM.\n+\n+3. Имена Классов\n+--------------\n+\n+Имена классов ДОЛЖНЫ быть определены используя `StudlyCaps`. Например, `Controller`, `Model`.\n+\n+4. Классы\n+----------\n+\n+В данном случае, под классом подразумеваются все классы и интерфейсы.\n+\n+- При именовании классов следует использовать `CamelCase`;\n+- Открывающая фигурная скобка всегда должна быть на следующей строке после имена класса;\n+- Все классы должны быть документированы в соответствии с PHPDoc;\n+- Весь код класса должен быть выровнен с использованием 4 пробелов;\n+- В одном PHP файле должен быть только один класс;\n+- Все классы должны использовать пространства имен;\n+- Имя класса должно совпадать с именем файла. Пространство имен класса должно соответствовать структуре каталогов.\n+\n+```php\n+/**\n+ * Документация\n+ */\n+class MyClass extends \\yii\\Object implements MyInterface\n+{\n+    // код\n+}\n+```\n+\n+### 4.1. Константы\n+\n+Константы класса ДОЛЖНЫ быть объявлены в верхнем регистре с подчеркиванием в качестве разделителей.\n+Пример:\n+\n+```php\n+<?php\n+class Foo\n+{\n+    const VERSION = '1.0';\n+    const DATE_APPROVED = '2012-06-01';\n+}\n+```\n+### 4.2. Свойства\n+\n+- При объявлении общедоступных (public) членов класса нужно использовать ключевое слово `public`;\n+- Общедоступные и защищенные (protected) переменные должны быть объявлены в начале класса, раньше объявления методов;\n+  Закрытые (private) переменные, так же, должны быть объявлены в начале класса, но могут быть добавлены и непосредственно перед методами, использующими их, в случае, если эти переменные используются только небольшой частью методов класса;\n+- Порядок объявления свойств класса должен соответствовать их видимости: общедоступные, защищенные и закрытые;\n+- Ограничений на порядок свойств одной области видимости нет;\n+- Для улучшения читаемости, следует не оставлять пустых строк между объявлением свойств и оставлять две пустые строки между объявлениями переменных и методов. Между объявлениями свойств разной области видимости нужно должна быть добавлена одна пустая строка;\n+- Закрытые переменные должны иметь имя вида `$_varName`;\n+- Общедоступные члены класса и отдельные переменные должны использовать `$camelCase`\n+  с первой буквой в нижнем регистре;\n+- Используйте понятные имена. Переменные вроде `$i` и `$j` лучше не использовать.\n+\n+Пример:\n+\n+```php\n+<?php\n+class Foo\n+{\n+    public $publicProp1;\n+    public $publicProp2;\n+\n+    protected $protectedProp;\n+\n+    private $_privateProp;\n+\n+\n+    public function someMethod()\n+    {\n+        // ...\n+    }\n+}\n+```\n+\n+### 4.3. Методы\n+\n+- При именовании методов и функций следует использовать `camelCase` с первой буквой в нижнем регистре;\n+- Имена должны быть понятными и отражать назначение функции;\n+- Методы классов должны быть объявлены с использованием одного из модификаторов `private`, `protected` или\n+  `public`. Использование `var` не допустимо;","path":"docs/internals-ru/core-code-style.md","position":118,"original_position":118,"commit_id":"c0d8c8870371715ba51265ca824718f626cdb14f","original_commit_id":"c0d8c8870371715ba51265ca824718f626cdb14f","user":{"login":"SilverFire","id":4499203,"avatar_url":"https://avatars.githubusercontent.com/u/4499203?v=3","gravatar_id":"","url":"https://api.github.com/users/SilverFire","html_url":"https://github.com/SilverFire","followers_url":"https://api.github.com/users/SilverFire/followers","following_url":"https://api.github.com/users/SilverFire/following{/other_user}","gists_url":"https://api.github.com/users/SilverFire/gists{/gist_id}","starred_url":"https://api.github.com/users/SilverFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilverFire/subscriptions","organizations_url":"https://api.github.com/users/SilverFire/orgs","repos_url":"https://api.github.com/users/SilverFire/repos","events_url":"https://api.github.com/users/SilverFire/events{/privacy}","received_events_url":"https://api.github.com/users/SilverFire/received_events","type":"User","site_admin":false},"body":"недопустимо","created_at":"2016-04-07T05:00:17Z","updated_at":"2016-04-07T05:00:17Z","html_url":"https://github.com/yiisoft/yii2/pull/11298#discussion_r58819376","pull_request_url":"https://api.github.com/repos/yiisoft/yii2/pulls/11298","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/58819376"},"html":{"href":"https://github.com/yiisoft/yii2/pull/11298#discussion_r58819376"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/11298"}}},"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/11298","id":65573159,"html_url":"https://github.com/yiisoft/yii2/pull/11298","diff_url":"https://github.com/yiisoft/yii2/pull/11298.diff","patch_url":"https://github.com/yiisoft/yii2/pull/11298.patch","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/11298","number":11298,"state":"open","locked":false,"title":"russian translation and small fixes in original core-code-style.md","user":{"login":"p0vidl0","id":6966538,"avatar_url":"https://avatars.githubusercontent.com/u/6966538?v=3","gravatar_id":"","url":"https://api.github.com/users/p0vidl0","html_url":"https://github.com/p0vidl0","followers_url":"https://api.github.com/users/p0vidl0/followers","following_url":"https://api.github.com/users/p0vidl0/following{/other_user}","gists_url":"https://api.github.com/users/p0vidl0/gists{/gist_id}","starred_url":"https://api.github.com/users/p0vidl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0vidl0/subscriptions","organizations_url":"https://api.github.com/users/p0vidl0/orgs","repos_url":"https://api.github.com/users/p0vidl0/repos","events_url":"https://api.github.com/users/p0vidl0/events{/privacy}","received_events_url":"https://api.github.com/users/p0vidl0/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Is bugfix?    | no\r\n| New feature?  | no\r\n| Breaks BC?    | no\r\n| Tests pass?   | yes\r\n| Fixed issues  | \r\n","created_at":"2016-04-07T04:40:01Z","updated_at":"2016-04-07T05:00:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce8afe75700f27a8f2f584e565c928af5302a6bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yiisoft/yii2/pulls/11298/commits","review_comments_url":"https://api.github.com/repos/yiisoft/yii2/pulls/11298/comments","review_comment_url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11298/comments","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/c0d8c8870371715ba51265ca824718f626cdb14f","head":{"label":"p0vidl0:master","ref":"master","sha":"c0d8c8870371715ba51265ca824718f626cdb14f","user":{"login":"p0vidl0","id":6966538,"avatar_url":"https://avatars.githubusercontent.com/u/6966538?v=3","gravatar_id":"","url":"https://api.github.com/users/p0vidl0","html_url":"https://github.com/p0vidl0","followers_url":"https://api.github.com/users/p0vidl0/followers","following_url":"https://api.github.com/users/p0vidl0/following{/other_user}","gists_url":"https://api.github.com/users/p0vidl0/gists{/gist_id}","starred_url":"https://api.github.com/users/p0vidl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0vidl0/subscriptions","organizations_url":"https://api.github.com/users/p0vidl0/orgs","repos_url":"https://api.github.com/users/p0vidl0/repos","events_url":"https://api.github.com/users/p0vidl0/events{/privacy}","received_events_url":"https://api.github.com/users/p0vidl0/received_events","type":"User","site_admin":false},"repo":{"id":45153408,"name":"yii2","full_name":"p0vidl0/yii2","owner":{"login":"p0vidl0","id":6966538,"avatar_url":"https://avatars.githubusercontent.com/u/6966538?v=3","gravatar_id":"","url":"https://api.github.com/users/p0vidl0","html_url":"https://github.com/p0vidl0","followers_url":"https://api.github.com/users/p0vidl0/followers","following_url":"https://api.github.com/users/p0vidl0/following{/other_user}","gists_url":"https://api.github.com/users/p0vidl0/gists{/gist_id}","starred_url":"https://api.github.com/users/p0vidl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p0vidl0/subscriptions","organizations_url":"https://api.github.com/users/p0vidl0/orgs","repos_url":"https://api.github.com/users/p0vidl0/repos","events_url":"https://api.github.com/users/p0vidl0/events{/privacy}","received_events_url":"https://api.github.com/users/p0vidl0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/p0vidl0/yii2","description":"Yii 2 framework main development repo","fork":true,"url":"https://api.github.com/repos/p0vidl0/yii2","forks_url":"https://api.github.com/repos/p0vidl0/yii2/forks","keys_url":"https://api.github.com/repos/p0vidl0/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/p0vidl0/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/p0vidl0/yii2/teams","hooks_url":"https://api.github.com/repos/p0vidl0/yii2/hooks","issue_events_url":"https://api.github.com/repos/p0vidl0/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/p0vidl0/yii2/events","assignees_url":"https://api.github.com/repos/p0vidl0/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/p0vidl0/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/p0vidl0/yii2/tags","blobs_url":"https://api.github.com/repos/p0vidl0/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/p0vidl0/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/p0vidl0/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/p0vidl0/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/p0vidl0/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/p0vidl0/yii2/languages","stargazers_url":"https://api.github.com/repos/p0vidl0/yii2/stargazers","contributors_url":"https://api.github.com/repos/p0vidl0/yii2/contributors","subscribers_url":"https://api.github.com/repos/p0vidl0/yii2/subscribers","subscription_url":"https://api.github.com/repos/p0vidl0/yii2/subscription","commits_url":"https://api.github.com/repos/p0vidl0/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/p0vidl0/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/p0vidl0/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/p0vidl0/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/p0vidl0/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/p0vidl0/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/p0vidl0/yii2/merges","archive_url":"https://api.github.com/repos/p0vidl0/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/p0vidl0/yii2/downloads","issues_url":"https://api.github.com/repos/p0vidl0/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/p0vidl0/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/p0vidl0/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/p0vidl0/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/p0vidl0/yii2/labels{/name}","releases_url":"https://api.github.com/repos/p0vidl0/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/p0vidl0/yii2/deployments","created_at":"2015-10-29T01:50:19Z","updated_at":"2016-04-07T03:04:01Z","pushed_at":"2016-04-07T04:30:23Z","git_url":"git://github.com/p0vidl0/yii2.git","ssh_url":"git@github.com:p0vidl0/yii2.git","clone_url":"https://github.com/p0vidl0/yii2.git","svn_url":"https://github.com/p0vidl0/yii2","homepage":"http://www.yiiframework.com","size":40408,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yiisoft:master","ref":"master","sha":"e5bcbf4e1ded7f56f71eb38105b3ea48280fa504","user":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":3431193,"name":"yii2","full_name":"yiisoft/yii2","owner":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yiisoft/yii2","description":"Yii 2 framework main development repo","fork":false,"url":"https://api.github.com/repos/yiisoft/yii2","forks_url":"https://api.github.com/repos/yiisoft/yii2/forks","keys_url":"https://api.github.com/repos/yiisoft/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiisoft/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiisoft/yii2/teams","hooks_url":"https://api.github.com/repos/yiisoft/yii2/hooks","issue_events_url":"https://api.github.com/repos/yiisoft/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/yiisoft/yii2/events","assignees_url":"https://api.github.com/repos/yiisoft/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/yiisoft/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/yiisoft/yii2/tags","blobs_url":"https://api.github.com/repos/yiisoft/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiisoft/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiisoft/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiisoft/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/yiisoft/yii2/languages","stargazers_url":"https://api.github.com/repos/yiisoft/yii2/stargazers","contributors_url":"https://api.github.com/repos/yiisoft/yii2/contributors","subscribers_url":"https://api.github.com/repos/yiisoft/yii2/subscribers","subscription_url":"https://api.github.com/repos/yiisoft/yii2/subscription","commits_url":"https://api.github.com/repos/yiisoft/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiisoft/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiisoft/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiisoft/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiisoft/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/yiisoft/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiisoft/yii2/merges","archive_url":"https://api.github.com/repos/yiisoft/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiisoft/yii2/downloads","issues_url":"https://api.github.com/repos/yiisoft/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/yiisoft/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/yiisoft/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/yiisoft/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiisoft/yii2/labels{/name}","releases_url":"https://api.github.com/repos/yiisoft/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/yiisoft/yii2/deployments","created_at":"2012-02-13T15:32:36Z","updated_at":"2016-04-07T03:11:46Z","pushed_at":"2016-04-07T04:40:01Z","git_url":"git://github.com/yiisoft/yii2.git","ssh_url":"git@github.com:yiisoft/yii2.git","clone_url":"https://github.com/yiisoft/yii2.git","svn_url":"https://github.com/yiisoft/yii2","homepage":"http://www.yiiframework.com","size":49025,"stargazers_count":7845,"watchers_count":7845,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4591,"mirror_url":null,"open_issues_count":1046,"forks":4591,"open_issues":1046,"watchers":7845,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/11298"},"html":{"href":"https://github.com/yiisoft/yii2/pull/11298"},"issue":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/11298"},"comments":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/11298/comments"},"review_comments":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/11298/comments"},"review_comment":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/11298/commits"},"statuses":{"href":"https://api.github.com/repos/yiisoft/yii2/statuses/c0d8c8870371715ba51265ca824718f626cdb14f"}}}}