{"action":"created","issue":{"url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/7","labels_url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/7/comments","events_url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/7/events","html_url":"https://github.com/andela-vdugeri/PersistenceManager/issues/7","id":111319621,"number":7,"title":"Inflect.php","user":{"login":"busayo","id":2946769,"avatar_url":"https://avatars.githubusercontent.com/u/2946769?v=3","gravatar_id":"","url":"https://api.github.com/users/busayo","html_url":"https://github.com/busayo","followers_url":"https://api.github.com/users/busayo/followers","following_url":"https://api.github.com/users/busayo/following{/other_user}","gists_url":"https://api.github.com/users/busayo/gists{/gist_id}","starred_url":"https://api.github.com/users/busayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/busayo/subscriptions","organizations_url":"https://api.github.com/users/busayo/orgs","repos_url":"https://api.github.com/users/busayo/repos","events_url":"https://api.github.com/users/busayo/events{/privacy}","received_events_url":"https://api.github.com/users/busayo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-14T04:00:04Z","updated_at":"2015-10-14T04:01:45Z","closed_at":null,"body":"`namespace Verem\\persistence\\Base;`\r\n\r\nWhat convention does this naming represent? . Why is the p in persistence small letter?"},"comment":{"url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/comments/147929247","html_url":"https://github.com/andela-vdugeri/PersistenceManager/issues/7#issuecomment-147929247","issue_url":"https://api.github.com/repos/andela-vdugeri/PersistenceManager/issues/7","id":147929247,"user":{"login":"busayo","id":2946769,"avatar_url":"https://avatars.githubusercontent.com/u/2946769?v=3","gravatar_id":"","url":"https://api.github.com/users/busayo","html_url":"https://github.com/busayo","followers_url":"https://api.github.com/users/busayo/followers","following_url":"https://api.github.com/users/busayo/following{/other_user}","gists_url":"https://api.github.com/users/busayo/gists{/gist_id}","starred_url":"https://api.github.com/users/busayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/busayo/subscriptions","organizations_url":"https://api.github.com/users/busayo/orgs","repos_url":"https://api.github.com/users/busayo/repos","events_url":"https://api.github.com/users/busayo/events{/privacy}","received_events_url":"https://api.github.com/users/busayo/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T04:01:45Z","updated_at":"2015-10-14T04:01:45Z","body":"```php\r\n// check for irregular singular forms\r\n        foreach (self::$irregular as $pattern => $result) {\r\n            $pattern = '/' . $pattern . '$/i';\r\n            if (preg_match($pattern, $string)) {\r\n                return preg_replace($pattern, $result, $string);\r\n            }\r\n        }\r\n        // check for matches using regular expressions\r\n        foreach (self::$plural as $pattern => $result) {\r\n            if (preg_match($pattern, $string)) {\r\n                return preg_replace($pattern, $result, $string);\r\n            }\r\n        }\r\n```\r\n\r\nThere is a repetition here \r\n\r\n```php\r\n  if (preg_match($pattern, $string)) {\r\n                return preg_replace($pattern, $result, $string);\r\n            }\r\n```\r\n\r\nAbstract it into a function and just call it"}}