{"action":"created","comment":{"url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/comments/27337358","id":27337358,"diff_hunk":"@@ -0,0 +1,100 @@\n+<?php\n+\n+/*\n+ * This file is part of the ONGR package.\n+ *\n+ * (c) NFQ Technologies UAB <info@nfq.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 ONGR\\ElasticsearchBundle\\DSL\\Aggregation;\n+\n+use ONGR\\ElasticsearchBundle\\DSL\\Aggregation\\Type\\MetricTrait;\n+use ONGR\\ElasticsearchBundle\\DSL\\ScriptAwareTrait;\n+\n+/**\n+ * Class representing Percentile Ranks Aggregation.\n+ */\n+class PercentileRanksAggregation extends AbstractAggregation\n+{\n+    use MetricTrait;\n+    use ScriptAwareTrait;\n+\n+    /**\n+     * @var array\n+     */\n+    private $values;\n+\n+    /**\n+     * @var int\n+     */\n+    private $compression;\n+\n+    /**\n+     * @return array\n+     */\n+    public function getValues()\n+    {\n+        return $this->values;\n+    }\n+\n+    /**\n+     * @param array $values\n+     */\n+    public function setValues($values)\n+    {\n+        $this->values = $values;\n+    }\n+\n+    /**\n+     * @return int\n+     */\n+    public function getCompression()\n+    {\n+        return $this->compression;\n+    }\n+\n+    /**\n+     * @param int $compression\n+     */\n+    public function setCompression($compression)\n+    {\n+        $this->compression = $compression;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getType()\n+    {\n+        return 'percentile_ranks';\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getArray()\n+    {\n+        $out = [];\n+\n+        if ($this->getField() && $this->getValues()) {\n+            $out['field'] = $this->getField();\n+            $out['values'] = $this->getValues();","path":"DSL/Aggregation/PercentileRanksAggregation.php","position":84,"original_position":84,"commit_id":"be2cfda37b6f080937b37e2fe47aea0b196d41de","original_commit_id":"be2cfda37b6f080937b37e2fe47aea0b196d41de","user":{"login":"martiis","id":4210866,"avatar_url":"https://avatars.githubusercontent.com/u/4210866?v=3","gravatar_id":"","url":"https://api.github.com/users/martiis","html_url":"https://github.com/martiis","followers_url":"https://api.github.com/users/martiis/followers","following_url":"https://api.github.com/users/martiis/following{/other_user}","gists_url":"https://api.github.com/users/martiis/gists{/gist_id}","starred_url":"https://api.github.com/users/martiis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martiis/subscriptions","organizations_url":"https://api.github.com/users/martiis/orgs","repos_url":"https://api.github.com/users/martiis/repos","events_url":"https://api.github.com/users/martiis/events{/privacy}","received_events_url":"https://api.github.com/users/martiis/received_events","type":"User","site_admin":false},"body":"these parts can be executed in one line instead of two. f.e.\r\n```\r\n$out = [\r\n  'field' => $this->getField(),\r\n  'values' => $this->getValues(),\r\n];\r\n```","created_at":"2015-03-27T23:04:11Z","updated_at":"2015-03-27T23:04:11Z","html_url":"https://github.com/ongr-io/ElasticsearchBundle/pull/289#discussion_r27337358","pull_request_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289","_links":{"self":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/comments/27337358"},"html":{"href":"https://github.com/ongr-io/ElasticsearchBundle/pull/289#discussion_r27337358"},"pull_request":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289"}}},"pull_request":{"url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289","id":31805929,"html_url":"https://github.com/ongr-io/ElasticsearchBundle/pull/289","diff_url":"https://github.com/ongr-io/ElasticsearchBundle/pull/289.diff","patch_url":"https://github.com/ongr-io/ElasticsearchBundle/pull/289.patch","issue_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/289","number":289,"state":"open","locked":false,"title":"Patch dsl scripts aggregations","user":{"login":"chyzas","id":7919897,"avatar_url":"https://avatars.githubusercontent.com/u/7919897?v=3","gravatar_id":"","url":"https://api.github.com/users/chyzas","html_url":"https://github.com/chyzas","followers_url":"https://api.github.com/users/chyzas/followers","following_url":"https://api.github.com/users/chyzas/following{/other_user}","gists_url":"https://api.github.com/users/chyzas/gists{/gist_id}","starred_url":"https://api.github.com/users/chyzas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyzas/subscriptions","organizations_url":"https://api.github.com/users/chyzas/orgs","repos_url":"https://api.github.com/users/chyzas/repos","events_url":"https://api.github.com/users/chyzas/events{/privacy}","received_events_url":"https://api.github.com/users/chyzas/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-24T08:39:06Z","updated_at":"2015-03-27T23:04:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b40ad7a9bab929f48f827397c98583745c4e3552","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289/commits","review_comments_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289/comments","review_comment_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/289/comments","statuses_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/statuses/be2cfda37b6f080937b37e2fe47aea0b196d41de","head":{"label":"chyzas:patch-dsl-scripts-aggregations","ref":"patch-dsl-scripts-aggregations","sha":"be2cfda37b6f080937b37e2fe47aea0b196d41de","user":{"login":"chyzas","id":7919897,"avatar_url":"https://avatars.githubusercontent.com/u/7919897?v=3","gravatar_id":"","url":"https://api.github.com/users/chyzas","html_url":"https://github.com/chyzas","followers_url":"https://api.github.com/users/chyzas/followers","following_url":"https://api.github.com/users/chyzas/following{/other_user}","gists_url":"https://api.github.com/users/chyzas/gists{/gist_id}","starred_url":"https://api.github.com/users/chyzas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyzas/subscriptions","organizations_url":"https://api.github.com/users/chyzas/orgs","repos_url":"https://api.github.com/users/chyzas/repos","events_url":"https://api.github.com/users/chyzas/events{/privacy}","received_events_url":"https://api.github.com/users/chyzas/received_events","type":"User","site_admin":false},"repo":{"id":30011162,"name":"ElasticsearchBundle","full_name":"chyzas/ElasticsearchBundle","owner":{"login":"chyzas","id":7919897,"avatar_url":"https://avatars.githubusercontent.com/u/7919897?v=3","gravatar_id":"","url":"https://api.github.com/users/chyzas","html_url":"https://github.com/chyzas","followers_url":"https://api.github.com/users/chyzas/followers","following_url":"https://api.github.com/users/chyzas/following{/other_user}","gists_url":"https://api.github.com/users/chyzas/gists{/gist_id}","starred_url":"https://api.github.com/users/chyzas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyzas/subscriptions","organizations_url":"https://api.github.com/users/chyzas/orgs","repos_url":"https://api.github.com/users/chyzas/repos","events_url":"https://api.github.com/users/chyzas/events{/privacy}","received_events_url":"https://api.github.com/users/chyzas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chyzas/ElasticsearchBundle","description":"Symfony2 bundle for elasticsearch","fork":true,"url":"https://api.github.com/repos/chyzas/ElasticsearchBundle","forks_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/forks","keys_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/teams","hooks_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/hooks","issue_events_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/issues/events{/number}","events_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/events","assignees_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/assignees{/user}","branches_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/branches{/branch}","tags_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/tags","blobs_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/languages","stargazers_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/stargazers","contributors_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/contributors","subscribers_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/subscribers","subscription_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/subscription","commits_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/contents/{+path}","compare_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/merges","archive_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/downloads","issues_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/issues{/number}","pulls_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/labels{/name}","releases_url":"https://api.github.com/repos/chyzas/ElasticsearchBundle/releases{/id}","created_at":"2015-01-29T08:34:44Z","updated_at":"2015-03-27T06:20:16Z","pushed_at":"2015-03-27T10:55:25Z","git_url":"git://github.com/chyzas/ElasticsearchBundle.git","ssh_url":"git@github.com:chyzas/ElasticsearchBundle.git","clone_url":"https://github.com/chyzas/ElasticsearchBundle.git","svn_url":"https://github.com/chyzas/ElasticsearchBundle","homepage":"","size":1469,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"ongr-io:master","ref":"master","sha":"e8233ea05ed508b1bcc3094610b167b835f166e9","user":{"login":"ongr-io","id":8971056,"avatar_url":"https://avatars.githubusercontent.com/u/8971056?v=3","gravatar_id":"","url":"https://api.github.com/users/ongr-io","html_url":"https://github.com/ongr-io","followers_url":"https://api.github.com/users/ongr-io/followers","following_url":"https://api.github.com/users/ongr-io/following{/other_user}","gists_url":"https://api.github.com/users/ongr-io/gists{/gist_id}","starred_url":"https://api.github.com/users/ongr-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ongr-io/subscriptions","organizations_url":"https://api.github.com/users/ongr-io/orgs","repos_url":"https://api.github.com/users/ongr-io/repos","events_url":"https://api.github.com/users/ongr-io/events{/privacy}","received_events_url":"https://api.github.com/users/ongr-io/received_events","type":"Organization","site_admin":false},"repo":{"id":25922479,"name":"ElasticsearchBundle","full_name":"ongr-io/ElasticsearchBundle","owner":{"login":"ongr-io","id":8971056,"avatar_url":"https://avatars.githubusercontent.com/u/8971056?v=3","gravatar_id":"","url":"https://api.github.com/users/ongr-io","html_url":"https://github.com/ongr-io","followers_url":"https://api.github.com/users/ongr-io/followers","following_url":"https://api.github.com/users/ongr-io/following{/other_user}","gists_url":"https://api.github.com/users/ongr-io/gists{/gist_id}","starred_url":"https://api.github.com/users/ongr-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ongr-io/subscriptions","organizations_url":"https://api.github.com/users/ongr-io/orgs","repos_url":"https://api.github.com/users/ongr-io/repos","events_url":"https://api.github.com/users/ongr-io/events{/privacy}","received_events_url":"https://api.github.com/users/ongr-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ongr-io/ElasticsearchBundle","description":"Symfony2 bundle for elasticsearch","fork":false,"url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle","forks_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/forks","keys_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/teams","hooks_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/hooks","issue_events_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/events{/number}","events_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/events","assignees_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/assignees{/user}","branches_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/branches{/branch}","tags_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/tags","blobs_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/languages","stargazers_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/stargazers","contributors_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/contributors","subscribers_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/subscribers","subscription_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/subscription","commits_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/contents/{+path}","compare_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/merges","archive_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/downloads","issues_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues{/number}","pulls_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/labels{/name}","releases_url":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/releases{/id}","created_at":"2014-10-29T13:37:30Z","updated_at":"2015-03-27T22:54:36Z","pushed_at":"2015-03-27T22:54:36Z","git_url":"git://github.com/ongr-io/ElasticsearchBundle.git","ssh_url":"git@github.com:ongr-io/ElasticsearchBundle.git","clone_url":"https://github.com/ongr-io/ElasticsearchBundle.git","svn_url":"https://github.com/ongr-io/ElasticsearchBundle","homepage":"","size":4637,"stargazers_count":73,"watchers_count":73,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":30,"mirror_url":null,"open_issues_count":37,"forks":30,"open_issues":37,"watchers":73,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289"},"html":{"href":"https://github.com/ongr-io/ElasticsearchBundle/pull/289"},"issue":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/289"},"comments":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/issues/289/comments"},"review_comments":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289/comments"},"review_comment":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/pulls/289/commits"},"statuses":{"href":"https://api.github.com/repos/ongr-io/ElasticsearchBundle/statuses/be2cfda37b6f080937b37e2fe47aea0b196d41de"}}}}