{"action":"opened","number":2,"pull_request":{"url":"https://api.github.com/repos/particle-php/Validator/pulls/2","id":31356170,"html_url":"https://github.com/particle-php/Validator/pull/2","diff_url":"https://github.com/particle-php/Validator/pull/2.diff","patch_url":"https://github.com/particle-php/Validator/pull/2.patch","issue_url":"https://api.github.com/repos/particle-php/Validator/issues/2","number":2,"state":"open","locked":false,"title":"Adding the ability to set global default messages.","user":{"login":"berry-langerak","id":203825,"avatar_url":"https://avatars.githubusercontent.com/u/203825?v=3","gravatar_id":"","url":"https://api.github.com/users/berry-langerak","html_url":"https://github.com/berry-langerak","followers_url":"https://api.github.com/users/berry-langerak/followers","following_url":"https://api.github.com/users/berry-langerak/following{/other_user}","gists_url":"https://api.github.com/users/berry-langerak/gists{/gist_id}","starred_url":"https://api.github.com/users/berry-langerak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berry-langerak/subscriptions","organizations_url":"https://api.github.com/users/berry-langerak/orgs","repos_url":"https://api.github.com/users/berry-langerak/repos","events_url":"https://api.github.com/users/berry-langerak/events{/privacy}","received_events_url":"https://api.github.com/users/berry-langerak/received_events","type":"User","site_admin":false},"body":"With this PR, it becomes possible to overwrite the global default messages. The specific messages for a certain key still have precedence, however.\r\n\r\n```php\r\n$this->validator->overwriteDefaultMessages([\r\n    Rule\\Length::TOO_SHORT => 'This is overwritten globally.'\r\n]);\r\n\r\n$this->validator->required('first_name')->length(5);\r\n\r\n$this->validator->validate(['first_name' => 'Rick']); // false\r\necho $this->validator->getMessages()['first_name'][Rule\\Length::TOO_SHORT]; // This is overwritten globally.\r\n```","created_at":"2015-03-17T17:10:10Z","updated_at":"2015-03-17T17:10:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/particle-php/Validator/pulls/2/commits","review_comments_url":"https://api.github.com/repos/particle-php/Validator/pulls/2/comments","review_comment_url":"https://api.github.com/repos/particle-php/Validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/particle-php/Validator/issues/2/comments","statuses_url":"https://api.github.com/repos/particle-php/Validator/statuses/44cb82e212cacbb3218262d24ee89ef8ea625f45","head":{"label":"berry-langerak:feature/adding-ability-to-set-default-messages","ref":"feature/adding-ability-to-set-default-messages","sha":"44cb82e212cacbb3218262d24ee89ef8ea625f45","user":{"login":"berry-langerak","id":203825,"avatar_url":"https://avatars.githubusercontent.com/u/203825?v=3","gravatar_id":"","url":"https://api.github.com/users/berry-langerak","html_url":"https://github.com/berry-langerak","followers_url":"https://api.github.com/users/berry-langerak/followers","following_url":"https://api.github.com/users/berry-langerak/following{/other_user}","gists_url":"https://api.github.com/users/berry-langerak/gists{/gist_id}","starred_url":"https://api.github.com/users/berry-langerak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berry-langerak/subscriptions","organizations_url":"https://api.github.com/users/berry-langerak/orgs","repos_url":"https://api.github.com/users/berry-langerak/repos","events_url":"https://api.github.com/users/berry-langerak/events{/privacy}","received_events_url":"https://api.github.com/users/berry-langerak/received_events","type":"User","site_admin":false},"repo":{"id":32402990,"name":"Validator","full_name":"berry-langerak/Validator","owner":{"login":"berry-langerak","id":203825,"avatar_url":"https://avatars.githubusercontent.com/u/203825?v=3","gravatar_id":"","url":"https://api.github.com/users/berry-langerak","html_url":"https://github.com/berry-langerak","followers_url":"https://api.github.com/users/berry-langerak/followers","following_url":"https://api.github.com/users/berry-langerak/following{/other_user}","gists_url":"https://api.github.com/users/berry-langerak/gists{/gist_id}","starred_url":"https://api.github.com/users/berry-langerak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berry-langerak/subscriptions","organizations_url":"https://api.github.com/users/berry-langerak/orgs","repos_url":"https://api.github.com/users/berry-langerak/repos","events_url":"https://api.github.com/users/berry-langerak/events{/privacy}","received_events_url":"https://api.github.com/users/berry-langerak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/berry-langerak/Validator","description":"Particle\\Validator is a validation library with an extremely clean API which makes validation fun!","fork":true,"url":"https://api.github.com/repos/berry-langerak/Validator","forks_url":"https://api.github.com/repos/berry-langerak/Validator/forks","keys_url":"https://api.github.com/repos/berry-langerak/Validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berry-langerak/Validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berry-langerak/Validator/teams","hooks_url":"https://api.github.com/repos/berry-langerak/Validator/hooks","issue_events_url":"https://api.github.com/repos/berry-langerak/Validator/issues/events{/number}","events_url":"https://api.github.com/repos/berry-langerak/Validator/events","assignees_url":"https://api.github.com/repos/berry-langerak/Validator/assignees{/user}","branches_url":"https://api.github.com/repos/berry-langerak/Validator/branches{/branch}","tags_url":"https://api.github.com/repos/berry-langerak/Validator/tags","blobs_url":"https://api.github.com/repos/berry-langerak/Validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berry-langerak/Validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berry-langerak/Validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/berry-langerak/Validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berry-langerak/Validator/statuses/{sha}","languages_url":"https://api.github.com/repos/berry-langerak/Validator/languages","stargazers_url":"https://api.github.com/repos/berry-langerak/Validator/stargazers","contributors_url":"https://api.github.com/repos/berry-langerak/Validator/contributors","subscribers_url":"https://api.github.com/repos/berry-langerak/Validator/subscribers","subscription_url":"https://api.github.com/repos/berry-langerak/Validator/subscription","commits_url":"https://api.github.com/repos/berry-langerak/Validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/berry-langerak/Validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/berry-langerak/Validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/berry-langerak/Validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/berry-langerak/Validator/contents/{+path}","compare_url":"https://api.github.com/repos/berry-langerak/Validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berry-langerak/Validator/merges","archive_url":"https://api.github.com/repos/berry-langerak/Validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berry-langerak/Validator/downloads","issues_url":"https://api.github.com/repos/berry-langerak/Validator/issues{/number}","pulls_url":"https://api.github.com/repos/berry-langerak/Validator/pulls{/number}","milestones_url":"https://api.github.com/repos/berry-langerak/Validator/milestones{/number}","notifications_url":"https://api.github.com/repos/berry-langerak/Validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berry-langerak/Validator/labels{/name}","releases_url":"https://api.github.com/repos/berry-langerak/Validator/releases{/id}","created_at":"2015-03-17T15:42:36Z","updated_at":"2015-03-17T15:42:37Z","pushed_at":"2015-03-17T17:07:49Z","git_url":"git://github.com/berry-langerak/Validator.git","ssh_url":"git@github.com:berry-langerak/Validator.git","clone_url":"https://github.com/berry-langerak/Validator.git","svn_url":"https://github.com/berry-langerak/Validator","homepage":null,"size":0,"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":"develop"}},"base":{"label":"particle-php:develop","ref":"develop","sha":"6fdd6758f3ae4b13463bd04093a2c51e63f0b80a","user":{"login":"particle-php","id":11145775,"avatar_url":"https://avatars.githubusercontent.com/u/11145775?v=3","gravatar_id":"","url":"https://api.github.com/users/particle-php","html_url":"https://github.com/particle-php","followers_url":"https://api.github.com/users/particle-php/followers","following_url":"https://api.github.com/users/particle-php/following{/other_user}","gists_url":"https://api.github.com/users/particle-php/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-php/subscriptions","organizations_url":"https://api.github.com/users/particle-php/orgs","repos_url":"https://api.github.com/users/particle-php/repos","events_url":"https://api.github.com/users/particle-php/events{/privacy}","received_events_url":"https://api.github.com/users/particle-php/received_events","type":"Organization","site_admin":false},"repo":{"id":32274301,"name":"Validator","full_name":"particle-php/Validator","owner":{"login":"particle-php","id":11145775,"avatar_url":"https://avatars.githubusercontent.com/u/11145775?v=3","gravatar_id":"","url":"https://api.github.com/users/particle-php","html_url":"https://github.com/particle-php","followers_url":"https://api.github.com/users/particle-php/followers","following_url":"https://api.github.com/users/particle-php/following{/other_user}","gists_url":"https://api.github.com/users/particle-php/gists{/gist_id}","starred_url":"https://api.github.com/users/particle-php/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/particle-php/subscriptions","organizations_url":"https://api.github.com/users/particle-php/orgs","repos_url":"https://api.github.com/users/particle-php/repos","events_url":"https://api.github.com/users/particle-php/events{/privacy}","received_events_url":"https://api.github.com/users/particle-php/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/particle-php/Validator","description":"Particle\\Validator is a validation library with an extremely clean API which makes validation fun!","fork":false,"url":"https://api.github.com/repos/particle-php/Validator","forks_url":"https://api.github.com/repos/particle-php/Validator/forks","keys_url":"https://api.github.com/repos/particle-php/Validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/particle-php/Validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/particle-php/Validator/teams","hooks_url":"https://api.github.com/repos/particle-php/Validator/hooks","issue_events_url":"https://api.github.com/repos/particle-php/Validator/issues/events{/number}","events_url":"https://api.github.com/repos/particle-php/Validator/events","assignees_url":"https://api.github.com/repos/particle-php/Validator/assignees{/user}","branches_url":"https://api.github.com/repos/particle-php/Validator/branches{/branch}","tags_url":"https://api.github.com/repos/particle-php/Validator/tags","blobs_url":"https://api.github.com/repos/particle-php/Validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/particle-php/Validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/particle-php/Validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/particle-php/Validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/particle-php/Validator/statuses/{sha}","languages_url":"https://api.github.com/repos/particle-php/Validator/languages","stargazers_url":"https://api.github.com/repos/particle-php/Validator/stargazers","contributors_url":"https://api.github.com/repos/particle-php/Validator/contributors","subscribers_url":"https://api.github.com/repos/particle-php/Validator/subscribers","subscription_url":"https://api.github.com/repos/particle-php/Validator/subscription","commits_url":"https://api.github.com/repos/particle-php/Validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/particle-php/Validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/particle-php/Validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/particle-php/Validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/particle-php/Validator/contents/{+path}","compare_url":"https://api.github.com/repos/particle-php/Validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/particle-php/Validator/merges","archive_url":"https://api.github.com/repos/particle-php/Validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/particle-php/Validator/downloads","issues_url":"https://api.github.com/repos/particle-php/Validator/issues{/number}","pulls_url":"https://api.github.com/repos/particle-php/Validator/pulls{/number}","milestones_url":"https://api.github.com/repos/particle-php/Validator/milestones{/number}","notifications_url":"https://api.github.com/repos/particle-php/Validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/particle-php/Validator/labels{/name}","releases_url":"https://api.github.com/repos/particle-php/Validator/releases{/id}","created_at":"2015-03-15T17:36:28Z","updated_at":"2015-03-17T16:50:37Z","pushed_at":"2015-03-17T16:50:37Z","git_url":"git://github.com/particle-php/Validator.git","ssh_url":"git@github.com:particle-php/Validator.git","clone_url":"https://github.com/particle-php/Validator.git","svn_url":"https://github.com/particle-php/Validator","homepage":null,"size":0,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/particle-php/Validator/pulls/2"},"html":{"href":"https://github.com/particle-php/Validator/pull/2"},"issue":{"href":"https://api.github.com/repos/particle-php/Validator/issues/2"},"comments":{"href":"https://api.github.com/repos/particle-php/Validator/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/particle-php/Validator/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/particle-php/Validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/particle-php/Validator/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/particle-php/Validator/statuses/44cb82e212cacbb3218262d24ee89ef8ea625f45"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":128,"deletions":15,"changed_files":5}}