{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/57049861","id":57049861,"diff_hunk":"@@ -0,0 +1,222 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\Inflector;\n+\n+/**\n+ * Converts words between singular and plural forms.\n+ *\n+ * @author Bernhard Schussek <bschussek@gmail.com>\n+ */\n+final class Inflector\n+{\n+    /**\n+     * Map English plural to singular suffixes.\n+     *\n+     * @var array\n+     *\n+     * @see http://english-zone.com/spelling/plurals.html\n+     * @see http://www.scribd.com/doc/3271143/List-of-100-Irregular-Plural-Nouns-in-English\n+     */\n+    private static $pluralMap = array(\n+        // First entry: plural suffix, reversed\n+        // Second entry: length of plural suffix\n+        // Third entry: Whether the suffix may succeed a vocal\n+        // Fourth entry: Whether the suffix may succeed a consonant\n+        // Fifth entry: singular suffix, normal\n+\n+        // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)\n+        array('a', 1, true, true, array('on', 'um')),\n+\n+        // nebulae (nebula)\n+        array('ea', 2, true, true, 'a'),\n+\n+        // services (service)\n+        array('secivres', 8, true, true, 'service'),\n+\n+        // mice (mouse), lice (louse)\n+        array('eci', 3, false, true, 'ouse'),\n+\n+        // geese (goose)\n+        array('esee', 4, false, true, 'oose'),\n+\n+        // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius)\n+        array('i', 1, true, true, 'us'),\n+\n+        // men (man), women (woman)\n+        array('nem', 3, true, true, 'man'),\n+\n+        // children (child)\n+        array('nerdlihc', 8, true, true, 'child'),\n+\n+        // oxen (ox)\n+        array('nexo', 4, false, false, 'ox'),\n+\n+        // indices (index), appendices (appendix), prices (price)\n+        array('seci', 4, false, true, array('ex', 'ix', 'ice')),\n+\n+        // selfies (selfie)\n+        array('seifles', 7, true, true, 'selfie'),\n+\n+        // movies (movie)\n+        array('seivom', 6, true, true, 'movie'),\n+\n+        // news (news)\n+        array('swen', 4, true, true, 'news'),\n+\n+        // series (series)\n+        array('seires', 6, true, true, 'series'),\n+\n+        // babies (baby)\n+        array('sei', 3, false, true, 'y'),\n+\n+        // accesses (access), addresses (address), kisses (kiss)\n+        array('sess', 4, true, false, 'ss'),\n+\n+        // analyses (analysis), ellipses (ellipsis), funguses (fungus),\n+        // neuroses (neurosis), theses (thesis), emphases (emphasis),\n+        // oases (oasis), crises (crisis), houses (house), bases (base),\n+        // atlases (atlas)\n+        array('ses', 3, true, true, array('s', 'se', 'sis')),\n+\n+        // objectives (objective), alternative (alternatives)\n+        array('sevit', 5, true, true, 'tive'),\n+\n+        // drives (drive)\n+        array('sevird', 6, false, true, 'drive'),\n+\n+        // lives (life), wives (wife)\n+        array('sevi', 4, false, true, 'ife'),\n+\n+        // moves (move)\n+        array('sevom', 5, true, true, 'move'),\n+\n+        // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff)\n+        array('sev', 3, true, true, array('f', 've', 'ff')),\n+\n+        // axes (axis), axes (ax), axes (axe)\n+        array('sexa', 4, false, false, array('ax', 'axe', 'axis')),\n+\n+        // indexes (index), matrixes (matrix)\n+        array('sex', 3, true, false, 'x'),\n+\n+        // quizzes (quiz)\n+        array('sezz', 4, true, false, 'z'),\n+\n+        // bureaus (bureau)\n+        array('suae', 4, false, true, 'eau'),\n+\n+        // roses (rose), garages (garage), cassettes (cassette),\n+        // waltzes (waltz), heroes (hero), bushes (bush), arches (arch),\n+        // shoes (shoe)\n+        array('se', 2, true, true, array('', 'e')),\n+\n+        // tags (tag)\n+        array('s', 1, true, true, ''),\n+\n+        // chateaux (chateau)\n+        array('xuae', 4, false, true, 'eau'),\n+    );\n+\n+    /**\n+     * This class should not be instantiated.\n+     */\n+    private function __construct()","path":"src/Symfony/Component/Inflector/Inflector.php","position":132,"original_position":132,"commit_id":"11f5c300ecdbcf3b1c8fd68fe8fd4504c3b3ea9f","original_commit_id":"d85bcad49c42f493d8c2b11d48b857de14d52fe3","user":{"login":"dunglas","id":57224,"avatar_url":"https://avatars.githubusercontent.com/u/57224?v=3","gravatar_id":"","url":"https://api.github.com/users/dunglas","html_url":"https://github.com/dunglas","followers_url":"https://api.github.com/users/dunglas/followers","following_url":"https://api.github.com/users/dunglas/following{/other_user}","gists_url":"https://api.github.com/users/dunglas/gists{/gist_id}","starred_url":"https://api.github.com/users/dunglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dunglas/subscriptions","organizations_url":"https://api.github.com/users/dunglas/orgs","repos_url":"https://api.github.com/users/dunglas/repos","events_url":"https://api.github.com/users/dunglas/events{/privacy}","received_events_url":"https://api.github.com/users/dunglas/received_events","type":"User","site_admin":false},"body":"Not necessary to inject it. You can construct it in a constructor for instance. The benefit is extensibility. Thanks to the interface you can replace the built in inflector with a custom one.","created_at":"2016-03-22T19:09:17Z","updated_at":"2016-03-22T19:09:17Z","html_url":"https://github.com/symfony/symfony/pull/18260#discussion_r57049861","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18260","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/57049861"},"html":{"href":"https://github.com/symfony/symfony/pull/18260#discussion_r57049861"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18260"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18260","id":63691979,"html_url":"https://github.com/symfony/symfony/pull/18260","diff_url":"https://github.com/symfony/symfony/pull/18260.diff","patch_url":"https://github.com/symfony/symfony/pull/18260.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18260","number":18260,"state":"open","locked":false,"title":"Add Inflector component (from StringUtil of PropertyAccess)","user":{"login":"teohhanhui","id":548843,"avatar_url":"https://avatars.githubusercontent.com/u/548843?v=3","gravatar_id":"","url":"https://api.github.com/users/teohhanhui","html_url":"https://github.com/teohhanhui","followers_url":"https://api.github.com/users/teohhanhui/followers","following_url":"https://api.github.com/users/teohhanhui/following{/other_user}","gists_url":"https://api.github.com/users/teohhanhui/gists{/gist_id}","starred_url":"https://api.github.com/users/teohhanhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teohhanhui/subscriptions","organizations_url":"https://api.github.com/users/teohhanhui/orgs","repos_url":"https://api.github.com/users/teohhanhui/repos","events_url":"https://api.github.com/users/teohhanhui/events{/privacy}","received_events_url":"https://api.github.com/users/teohhanhui/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | yes\r\n| Tests pass?   | no\r\n| Fixed tickets | N/A\r\n| License       | MIT\r\n| Doc PR        | N/A\r\n\r\nAs proposed by @dunglas here: https://github.com/symfony/symfony/issues/18166#issuecomment-196707518\r\n\r\nThis will help us fix #18166","created_at":"2016-03-22T09:41:41Z","updated_at":"2016-03-22T19:09:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06d9247a9f4c246616ddc6257a2d59c936f2348a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18260/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18260/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18260/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/11f5c300ecdbcf3b1c8fd68fe8fd4504c3b3ea9f","head":{"label":"teohhanhui:inflector-component","ref":"inflector-component","sha":"11f5c300ecdbcf3b1c8fd68fe8fd4504c3b3ea9f","user":{"login":"teohhanhui","id":548843,"avatar_url":"https://avatars.githubusercontent.com/u/548843?v=3","gravatar_id":"","url":"https://api.github.com/users/teohhanhui","html_url":"https://github.com/teohhanhui","followers_url":"https://api.github.com/users/teohhanhui/followers","following_url":"https://api.github.com/users/teohhanhui/following{/other_user}","gists_url":"https://api.github.com/users/teohhanhui/gists{/gist_id}","starred_url":"https://api.github.com/users/teohhanhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teohhanhui/subscriptions","organizations_url":"https://api.github.com/users/teohhanhui/orgs","repos_url":"https://api.github.com/users/teohhanhui/repos","events_url":"https://api.github.com/users/teohhanhui/events{/privacy}","received_events_url":"https://api.github.com/users/teohhanhui/received_events","type":"User","site_admin":false},"repo":{"id":15574651,"name":"symfony","full_name":"teohhanhui/symfony","owner":{"login":"teohhanhui","id":548843,"avatar_url":"https://avatars.githubusercontent.com/u/548843?v=3","gravatar_id":"","url":"https://api.github.com/users/teohhanhui","html_url":"https://github.com/teohhanhui","followers_url":"https://api.github.com/users/teohhanhui/followers","following_url":"https://api.github.com/users/teohhanhui/following{/other_user}","gists_url":"https://api.github.com/users/teohhanhui/gists{/gist_id}","starred_url":"https://api.github.com/users/teohhanhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teohhanhui/subscriptions","organizations_url":"https://api.github.com/users/teohhanhui/orgs","repos_url":"https://api.github.com/users/teohhanhui/repos","events_url":"https://api.github.com/users/teohhanhui/events{/privacy}","received_events_url":"https://api.github.com/users/teohhanhui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/teohhanhui/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/teohhanhui/symfony","forks_url":"https://api.github.com/repos/teohhanhui/symfony/forks","keys_url":"https://api.github.com/repos/teohhanhui/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/teohhanhui/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/teohhanhui/symfony/teams","hooks_url":"https://api.github.com/repos/teohhanhui/symfony/hooks","issue_events_url":"https://api.github.com/repos/teohhanhui/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/teohhanhui/symfony/events","assignees_url":"https://api.github.com/repos/teohhanhui/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/teohhanhui/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/teohhanhui/symfony/tags","blobs_url":"https://api.github.com/repos/teohhanhui/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/teohhanhui/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/teohhanhui/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/teohhanhui/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/teohhanhui/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/teohhanhui/symfony/languages","stargazers_url":"https://api.github.com/repos/teohhanhui/symfony/stargazers","contributors_url":"https://api.github.com/repos/teohhanhui/symfony/contributors","subscribers_url":"https://api.github.com/repos/teohhanhui/symfony/subscribers","subscription_url":"https://api.github.com/repos/teohhanhui/symfony/subscription","commits_url":"https://api.github.com/repos/teohhanhui/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/teohhanhui/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/teohhanhui/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/teohhanhui/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/teohhanhui/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/teohhanhui/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/teohhanhui/symfony/merges","archive_url":"https://api.github.com/repos/teohhanhui/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/teohhanhui/symfony/downloads","issues_url":"https://api.github.com/repos/teohhanhui/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/teohhanhui/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/teohhanhui/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/teohhanhui/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/teohhanhui/symfony/labels{/name}","releases_url":"https://api.github.com/repos/teohhanhui/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/teohhanhui/symfony/deployments","created_at":"2014-01-02T03:07:48Z","updated_at":"2015-08-07T05:49:14Z","pushed_at":"2016-03-22T18:16:20Z","git_url":"git://github.com/teohhanhui/symfony.git","ssh_url":"git@github.com:teohhanhui/symfony.git","clone_url":"https://github.com/teohhanhui/symfony.git","svn_url":"https://github.com/teohhanhui/symfony","homepage":"symfony.com","size":69436,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"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":"symfony:master","ref":"master","sha":"003507db6a08306c22f9f28d0d9b4ddf0cdead42","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-03-22T15:23:47Z","pushed_at":"2016-03-22T19:03:28Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":104504,"stargazers_count":11966,"watchers_count":11966,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4723,"mirror_url":null,"open_issues_count":710,"forks":4723,"open_issues":710,"watchers":11966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18260"},"html":{"href":"https://github.com/symfony/symfony/pull/18260"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18260"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18260/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18260/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18260/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/11f5c300ecdbcf3b1c8fd68fe8fd4504c3b3ea9f"}}}}