{"action":"created","comment":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/30758912","id":30758912,"diff_hunk":"@@ -0,0 +1,349 @@\n+﻿Implementações exemplo do PSR-4\n+===============================\n+\n+Os exemplos a seguir ilustram códigos compatíveis com o PSR-4:\n+\n+Exemplo de Closure\n+------------------\n+\n+```php\n+<?php\n+/**\n+ * Um exemplo de uma implementação para um projeto específico.\n+ * \n+ * Após registrar esta função de carregamento automático com SPL, a seguinte linha\n+ * faria a função tentar carregar a classe \\Foo\\Bar\\Baz\\Qux\n+ * de /path/to/project/src/Baz/Qux.php:\n+ * \n+ *      new \\Foo\\Bar\\Baz\\Qux;\n+ *\n+ * @param string $class O nome de classe totalmente qualificado.\n+ * @return void\n+ * /\n+spl_autoload_register(function ($class) {\n+    \n+    // prefixo de namespace específico do projeto\n+    $prefix = 'Foo\\\\Bar\\\\';\n+\n+    // diretório base para o prefixo de namespace\n+    $base_dir = __DIR__ . '/src/';\n+    \n+    // a classe usa o prefixo de namespace?\n+    $len = strlen($prefix);\n+    if (strncmp($prefix, $class, $len) !== 0) {\n+        // não, passa para o próximo carregador automático registrado\n+        return;\n+    }\n+    \n+    // busca o nome de classe relativo\n+    $relative_class = substr($class, $len);\n+    \n+    // substitui o prefixo de namespace com o diretório base, substitui os separadores\n+    // de namespace com os separadores de diretório no nome de classe relativo, acrescentando\n+    // .php","path":"accepted/pt-BR/PSR-4-autoloader-examples.md","position":43,"original_position":43,"commit_id":"a0b6118ea0a05305a13effcd6c306e50104c11db","original_commit_id":"a0b6118ea0a05305a13effcd6c306e50104c11db","user":{"login":"henriquemoody","id":154023,"avatar_url":"https://avatars.githubusercontent.com/u/154023?v=3","gravatar_id":"","url":"https://api.github.com/users/henriquemoody","html_url":"https://github.com/henriquemoody","followers_url":"https://api.github.com/users/henriquemoody/followers","following_url":"https://api.github.com/users/henriquemoody/following{/other_user}","gists_url":"https://api.github.com/users/henriquemoody/gists{/gist_id}","starred_url":"https://api.github.com/users/henriquemoody/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henriquemoody/subscriptions","organizations_url":"https://api.github.com/users/henriquemoody/orgs","repos_url":"https://api.github.com/users/henriquemoody/repos","events_url":"https://api.github.com/users/henriquemoody/events{/privacy}","received_events_url":"https://api.github.com/users/henriquemoody/received_events","type":"User","site_admin":false},"body":"It will look better if you put _acrescentando_  in this same line","created_at":"2015-05-20T23:05:31Z","updated_at":"2015-05-20T23:05:31Z","html_url":"https://github.com/php-fig/fig-standards/pull/447#discussion_r30758912","pull_request_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/447","_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/30758912"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/447#discussion_r30758912"},"pull_request":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/447"}}},"pull_request":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/447","id":30255058,"html_url":"https://github.com/php-fig/fig-standards/pull/447","diff_url":"https://github.com/php-fig/fig-standards/pull/447.diff","patch_url":"https://github.com/php-fig/fig-standards/pull/447.patch","issue_url":"https://api.github.com/repos/php-fig/fig-standards/issues/447","number":447,"state":"open","locked":false,"title":"[PSR-4] Brazilian Portuguese Translation","user":{"login":"andreia","id":38911,"avatar_url":"https://avatars.githubusercontent.com/u/38911?v=3","gravatar_id":"","url":"https://api.github.com/users/andreia","html_url":"https://github.com/andreia","followers_url":"https://api.github.com/users/andreia/followers","following_url":"https://api.github.com/users/andreia/following{/other_user}","gists_url":"https://api.github.com/users/andreia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreia/subscriptions","organizations_url":"https://api.github.com/users/andreia/orgs","repos_url":"https://api.github.com/users/andreia/repos","events_url":"https://api.github.com/users/andreia/events{/privacy}","received_events_url":"https://api.github.com/users/andreia/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-02T02:30:02Z","updated_at":"2015-05-20T23:05:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14a6f2951f6229b0452e9257ea270c6acdcaa0d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/447/commits","review_comments_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/447/comments","review_comment_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/issues/447/comments","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/a0b6118ea0a05305a13effcd6c306e50104c11db","head":{"label":"andreia:ptbr_translation_psr4","ref":"ptbr_translation_psr4","sha":"a0b6118ea0a05305a13effcd6c306e50104c11db","user":{"login":"andreia","id":38911,"avatar_url":"https://avatars.githubusercontent.com/u/38911?v=3","gravatar_id":"","url":"https://api.github.com/users/andreia","html_url":"https://github.com/andreia","followers_url":"https://api.github.com/users/andreia/followers","following_url":"https://api.github.com/users/andreia/following{/other_user}","gists_url":"https://api.github.com/users/andreia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreia/subscriptions","organizations_url":"https://api.github.com/users/andreia/orgs","repos_url":"https://api.github.com/users/andreia/repos","events_url":"https://api.github.com/users/andreia/events{/privacy}","received_events_url":"https://api.github.com/users/andreia/received_events","type":"User","site_admin":false},"repo":{"id":19362111,"name":"fig-standards","full_name":"andreia/fig-standards","owner":{"login":"andreia","id":38911,"avatar_url":"https://avatars.githubusercontent.com/u/38911?v=3","gravatar_id":"","url":"https://api.github.com/users/andreia","html_url":"https://github.com/andreia","followers_url":"https://api.github.com/users/andreia/followers","following_url":"https://api.github.com/users/andreia/following{/other_user}","gists_url":"https://api.github.com/users/andreia/gists{/gist_id}","starred_url":"https://api.github.com/users/andreia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreia/subscriptions","organizations_url":"https://api.github.com/users/andreia/orgs","repos_url":"https://api.github.com/users/andreia/repos","events_url":"https://api.github.com/users/andreia/events{/privacy}","received_events_url":"https://api.github.com/users/andreia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreia/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":true,"url":"https://api.github.com/repos/andreia/fig-standards","forks_url":"https://api.github.com/repos/andreia/fig-standards/forks","keys_url":"https://api.github.com/repos/andreia/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreia/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreia/fig-standards/teams","hooks_url":"https://api.github.com/repos/andreia/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/andreia/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/andreia/fig-standards/events","assignees_url":"https://api.github.com/repos/andreia/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/andreia/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/andreia/fig-standards/tags","blobs_url":"https://api.github.com/repos/andreia/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreia/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreia/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreia/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreia/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/andreia/fig-standards/languages","stargazers_url":"https://api.github.com/repos/andreia/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/andreia/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/andreia/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/andreia/fig-standards/subscription","commits_url":"https://api.github.com/repos/andreia/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreia/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreia/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreia/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreia/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/andreia/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreia/fig-standards/merges","archive_url":"https://api.github.com/repos/andreia/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreia/fig-standards/downloads","issues_url":"https://api.github.com/repos/andreia/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/andreia/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/andreia/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/andreia/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreia/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/andreia/fig-standards/releases{/id}","created_at":"2014-05-02T00:40:10Z","updated_at":"2015-03-02T02:02:39Z","pushed_at":"2015-03-02T02:27:35Z","git_url":"git://github.com/andreia/fig-standards.git","ssh_url":"git@github.com:andreia/fig-standards.git","clone_url":"https://github.com/andreia/fig-standards.git","svn_url":"https://github.com/andreia/fig-standards","homepage":"http://www.php-fig.org/","size":1318,"stargazers_count":0,"watchers_count":0,"language":null,"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":"php-fig:master","ref":"master","sha":"cedf95a55d73cac648ebc3a695cd5f978add2287","user":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"repo":{"id":1053270,"name":"fig-standards","full_name":"php-fig/fig-standards","owner":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-fig/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":false,"url":"https://api.github.com/repos/php-fig/fig-standards","forks_url":"https://api.github.com/repos/php-fig/fig-standards/forks","keys_url":"https://api.github.com/repos/php-fig/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-fig/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-fig/fig-standards/teams","hooks_url":"https://api.github.com/repos/php-fig/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/php-fig/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/php-fig/fig-standards/events","assignees_url":"https://api.github.com/repos/php-fig/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/php-fig/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/php-fig/fig-standards/tags","blobs_url":"https://api.github.com/repos/php-fig/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-fig/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-fig/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-fig/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/php-fig/fig-standards/languages","stargazers_url":"https://api.github.com/repos/php-fig/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/php-fig/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/php-fig/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/php-fig/fig-standards/subscription","commits_url":"https://api.github.com/repos/php-fig/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-fig/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-fig/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-fig/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/php-fig/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-fig/fig-standards/merges","archive_url":"https://api.github.com/repos/php-fig/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-fig/fig-standards/downloads","issues_url":"https://api.github.com/repos/php-fig/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/php-fig/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/php-fig/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/php-fig/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-fig/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/php-fig/fig-standards/releases{/id}","created_at":"2010-11-05T04:44:12Z","updated_at":"2015-05-20T22:32:01Z","pushed_at":"2015-05-20T22:32:35Z","git_url":"git://github.com/php-fig/fig-standards.git","ssh_url":"git@github.com:php-fig/fig-standards.git","clone_url":"https://github.com/php-fig/fig-standards.git","svn_url":"https://github.com/php-fig/fig-standards","homepage":"http://www.php-fig.org/","size":7345,"stargazers_count":6092,"watchers_count":6092,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1477,"mirror_url":null,"open_issues_count":83,"forks":1477,"open_issues":83,"watchers":6092,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/447"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/447"},"issue":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/447"},"comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/447/comments"},"review_comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/447/comments"},"review_comment":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/447/commits"},"statuses":{"href":"https://api.github.com/repos/php-fig/fig-standards/statuses/a0b6118ea0a05305a13effcd6c306e50104c11db"}}}}