{"action":"created","comment":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments/184668706","pull_request_review_id":115913854,"id":184668706,"diff_hunk":"@@ -31,43 +31,31 @@\n \n class PaymentOptionsFinderCore extends HookFinder\n {\n+    /**\n+     * Collects available payment options from three different hooks\n+     * \n+     * @return array An array of available payment options\n+     * \n+     * @see HookFinder::find()\n+     */\n     public function find() //getPaymentOptions()\n     {\n         // Payment options coming from intermediate, deprecated version of the Advanced API\n         $this->hookName = 'displayPaymentEU';\n         $rawDisplayPaymentEUOptions = parent::find();\n-\n-        if (!is_array($rawDisplayPaymentEUOptions)) {\n-            $rawDisplayPaymentEUOptions = array();\n-        }\n-\n-        $displayPaymentEUOptions = array_map(\n+        $paymentOptions = array_map(\n             array('PrestaShop\\PrestaShop\\Core\\Payment\\PaymentOption', 'convertLegacyOption'),\n             $rawDisplayPaymentEUOptions\n         );\n \n-        // Payment options coming from regular Advanced API\n+        // Advanced payment options coming from regular Advanced API\n         $this->hookName = 'advancedPaymentOptions';\n-        $advancedPaymentOptions = parent::find();\n-        if (!is_array($advancedPaymentOptions)) {\n-            $advancedPaymentOptions = array();\n-        }\n+        $paymentOptions = array_merge($paymentOptions, parent::find());\n \n         // Payment options coming from regular Advanced API\n         $this->hookName = 'paymentOptions';\n         $this->expectedInstanceClasses = array('PrestaShop\\PrestaShop\\Core\\Payment\\PaymentOption');\n-        $newOption = parent::find();\n-        if (!is_array($newOption)) {\n-            $newOption = array();\n-        }\n-\n-        $paymentOptions = array_merge($displayPaymentEUOptions, $advancedPaymentOptions, $newOption);\n-\n-        foreach ($paymentOptions as $paymentOptionKey => $paymentOption) {\n-            if (!is_array($paymentOption)) {\n-                unset($paymentOptions[$paymentOptionKey]);\n-            }\n-        }","path":"classes/checkout/PaymentOptionsFinder.php","position":50,"original_position":50,"commit_id":"eaf6b76648b637034c2e62742203f9a04c45de3d","original_commit_id":"eaf6b76648b637034c2e62742203f9a04c45de3d","user":{"login":"michaelKaefer","id":13886409,"avatar_url":"https://avatars3.githubusercontent.com/u/13886409?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelKaefer","html_url":"https://github.com/michaelKaefer","followers_url":"https://api.github.com/users/michaelKaefer/followers","following_url":"https://api.github.com/users/michaelKaefer/following{/other_user}","gists_url":"https://api.github.com/users/michaelKaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelKaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelKaefer/subscriptions","organizations_url":"https://api.github.com/users/michaelKaefer/orgs","repos_url":"https://api.github.com/users/michaelKaefer/repos","events_url":"https://api.github.com/users/michaelKaefer/events{/privacy}","received_events_url":"https://api.github.com/users/michaelKaefer/received_events","type":"User","site_admin":false},"body":"As far as I can see parent::find() does all the checks, so I removed doubled safety checks hopefully :D","created_at":"2018-04-27T12:09:43Z","updated_at":"2018-04-27T12:09:43Z","html_url":"https://github.com/PrestaShop/PrestaShop/pull/8996#discussion_r184668706","pull_request_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments/184668706"},"html":{"href":"https://github.com/PrestaShop/PrestaShop/pull/8996#discussion_r184668706"},"pull_request":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996"}},"in_reply_to_id":184636278},"pull_request":{"url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996","id":184429755,"html_url":"https://github.com/PrestaShop/PrestaShop/pull/8996","diff_url":"https://github.com/PrestaShop/PrestaShop/pull/8996.diff","patch_url":"https://github.com/PrestaShop/PrestaShop/pull/8996.patch","issue_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/8996","number":8996,"state":"open","locked":false,"title":"New doc block for method, reduced code of method","user":{"login":"michaelKaefer","id":13886409,"avatar_url":"https://avatars3.githubusercontent.com/u/13886409?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelKaefer","html_url":"https://github.com/michaelKaefer","followers_url":"https://api.github.com/users/michaelKaefer/followers","following_url":"https://api.github.com/users/michaelKaefer/following{/other_user}","gists_url":"https://api.github.com/users/michaelKaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelKaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelKaefer/subscriptions","organizations_url":"https://api.github.com/users/michaelKaefer/orgs","repos_url":"https://api.github.com/users/michaelKaefer/repos","events_url":"https://api.github.com/users/michaelKaefer/events{/privacy}","received_events_url":"https://api.github.com/users/michaelKaefer/received_events","type":"User","site_admin":false},"body":"HookFinder::find() always returns an array, that's why I removed the checks.\r\n\r\n| Questions     | Answers\r\n| ------------- | -------------------------------------------------------\r\n| Branch?       | develop\r\n| Description?  | See commit message\r\n| Type?         | improvement\r\n| Category?     | CO\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Fixed ticket? | -\r\n| How to test?  | No additional test needed\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/prestashop/prestashop/8996)\n<!-- Reviewable:end -->\n","created_at":"2018-04-26T18:43:03Z","updated_at":"2018-04-27T12:09:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0f296488d01ca1fb2e9571912e893eec60a0aca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":904910825,"url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels/develop","name":"develop","color":"3ce091","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996/commits","review_comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996/comments","review_comment_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/8996/comments","statuses_url":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/eaf6b76648b637034c2e62742203f9a04c45de3d","head":{"label":"michaelKaefer:patch-1","ref":"patch-1","sha":"eaf6b76648b637034c2e62742203f9a04c45de3d","user":{"login":"michaelKaefer","id":13886409,"avatar_url":"https://avatars3.githubusercontent.com/u/13886409?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelKaefer","html_url":"https://github.com/michaelKaefer","followers_url":"https://api.github.com/users/michaelKaefer/followers","following_url":"https://api.github.com/users/michaelKaefer/following{/other_user}","gists_url":"https://api.github.com/users/michaelKaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelKaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelKaefer/subscriptions","organizations_url":"https://api.github.com/users/michaelKaefer/orgs","repos_url":"https://api.github.com/users/michaelKaefer/repos","events_url":"https://api.github.com/users/michaelKaefer/events{/privacy}","received_events_url":"https://api.github.com/users/michaelKaefer/received_events","type":"User","site_admin":false},"repo":{"id":130403536,"name":"PrestaShop","full_name":"michaelKaefer/PrestaShop","owner":{"login":"michaelKaefer","id":13886409,"avatar_url":"https://avatars3.githubusercontent.com/u/13886409?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelKaefer","html_url":"https://github.com/michaelKaefer","followers_url":"https://api.github.com/users/michaelKaefer/followers","following_url":"https://api.github.com/users/michaelKaefer/following{/other_user}","gists_url":"https://api.github.com/users/michaelKaefer/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelKaefer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelKaefer/subscriptions","organizations_url":"https://api.github.com/users/michaelKaefer/orgs","repos_url":"https://api.github.com/users/michaelKaefer/repos","events_url":"https://api.github.com/users/michaelKaefer/events{/privacy}","received_events_url":"https://api.github.com/users/michaelKaefer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/michaelKaefer/PrestaShop","description":"PrestaShop offers a free, fully scalable, Open Source e-commerce solution.","fork":true,"url":"https://api.github.com/repos/michaelKaefer/PrestaShop","forks_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/forks","keys_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/teams","hooks_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/hooks","issue_events_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/issues/events{/number}","events_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/events","assignees_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/assignees{/user}","branches_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/branches{/branch}","tags_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/tags","blobs_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/git/refs{/sha}","trees_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/statuses/{sha}","languages_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/languages","stargazers_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/stargazers","contributors_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/contributors","subscribers_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/subscribers","subscription_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/subscription","commits_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/commits{/sha}","git_commits_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/git/commits{/sha}","comments_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/comments{/number}","issue_comment_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/issues/comments{/number}","contents_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/contents/{+path}","compare_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/merges","archive_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/downloads","issues_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/issues{/number}","pulls_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/pulls{/number}","milestones_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/milestones{/number}","notifications_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/labels{/name}","releases_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/releases{/id}","deployments_url":"https://api.github.com/repos/michaelKaefer/PrestaShop/deployments","created_at":"2018-04-20T19:07:11Z","updated_at":"2018-04-20T19:07:29Z","pushed_at":"2018-04-26T18:39:58Z","git_url":"git://github.com/michaelKaefer/PrestaShop.git","ssh_url":"git@github.com:michaelKaefer/PrestaShop.git","clone_url":"https://github.com/michaelKaefer/PrestaShop.git","svn_url":"https://github.com/michaelKaefer/PrestaShop","homepage":"http://www.prestashop.com/","size":318491,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PrestaShop:develop","ref":"develop","sha":"cabcb3a350f31eb7b2a1f8265ca72c831f146d7f","user":{"login":"PrestaShop","id":2815696,"avatar_url":"https://avatars3.githubusercontent.com/u/2815696?v=4","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"repo":{"id":6763587,"name":"PrestaShop","full_name":"PrestaShop/PrestaShop","owner":{"login":"PrestaShop","id":2815696,"avatar_url":"https://avatars3.githubusercontent.com/u/2815696?v=4","gravatar_id":"","url":"https://api.github.com/users/PrestaShop","html_url":"https://github.com/PrestaShop","followers_url":"https://api.github.com/users/PrestaShop/followers","following_url":"https://api.github.com/users/PrestaShop/following{/other_user}","gists_url":"https://api.github.com/users/PrestaShop/gists{/gist_id}","starred_url":"https://api.github.com/users/PrestaShop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrestaShop/subscriptions","organizations_url":"https://api.github.com/users/PrestaShop/orgs","repos_url":"https://api.github.com/users/PrestaShop/repos","events_url":"https://api.github.com/users/PrestaShop/events{/privacy}","received_events_url":"https://api.github.com/users/PrestaShop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PrestaShop/PrestaShop","description":"PrestaShop offers a free, fully scalable, Open Source e-commerce solution.","fork":false,"url":"https://api.github.com/repos/PrestaShop/PrestaShop","forks_url":"https://api.github.com/repos/PrestaShop/PrestaShop/forks","keys_url":"https://api.github.com/repos/PrestaShop/PrestaShop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PrestaShop/PrestaShop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PrestaShop/PrestaShop/teams","hooks_url":"https://api.github.com/repos/PrestaShop/PrestaShop/hooks","issue_events_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/events{/number}","events_url":"https://api.github.com/repos/PrestaShop/PrestaShop/events","assignees_url":"https://api.github.com/repos/PrestaShop/PrestaShop/assignees{/user}","branches_url":"https://api.github.com/repos/PrestaShop/PrestaShop/branches{/branch}","tags_url":"https://api.github.com/repos/PrestaShop/PrestaShop/tags","blobs_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/refs{/sha}","trees_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/{sha}","languages_url":"https://api.github.com/repos/PrestaShop/PrestaShop/languages","stargazers_url":"https://api.github.com/repos/PrestaShop/PrestaShop/stargazers","contributors_url":"https://api.github.com/repos/PrestaShop/PrestaShop/contributors","subscribers_url":"https://api.github.com/repos/PrestaShop/PrestaShop/subscribers","subscription_url":"https://api.github.com/repos/PrestaShop/PrestaShop/subscription","commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/commits{/sha}","git_commits_url":"https://api.github.com/repos/PrestaShop/PrestaShop/git/commits{/sha}","comments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/comments{/number}","issue_comment_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/comments{/number}","contents_url":"https://api.github.com/repos/PrestaShop/PrestaShop/contents/{+path}","compare_url":"https://api.github.com/repos/PrestaShop/PrestaShop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PrestaShop/PrestaShop/merges","archive_url":"https://api.github.com/repos/PrestaShop/PrestaShop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PrestaShop/PrestaShop/downloads","issues_url":"https://api.github.com/repos/PrestaShop/PrestaShop/issues{/number}","pulls_url":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls{/number}","milestones_url":"https://api.github.com/repos/PrestaShop/PrestaShop/milestones{/number}","notifications_url":"https://api.github.com/repos/PrestaShop/PrestaShop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PrestaShop/PrestaShop/labels{/name}","releases_url":"https://api.github.com/repos/PrestaShop/PrestaShop/releases{/id}","deployments_url":"https://api.github.com/repos/PrestaShop/PrestaShop/deployments","created_at":"2012-11-19T16:41:31Z","updated_at":"2018-04-26T16:25:44Z","pushed_at":"2018-04-27T11:34:26Z","git_url":"git://github.com/PrestaShop/PrestaShop.git","ssh_url":"git@github.com:PrestaShop/PrestaShop.git","clone_url":"https://github.com/PrestaShop/PrestaShop.git","svn_url":"https://github.com/PrestaShop/PrestaShop","homepage":"http://www.prestashop.com/","size":332878,"stargazers_count":3001,"watchers_count":3001,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2726,"mirror_url":null,"archived":false,"open_issues_count":319,"license":null,"forks":2726,"open_issues":319,"watchers":3001,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996"},"html":{"href":"https://github.com/PrestaShop/PrestaShop/pull/8996"},"issue":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/8996"},"comments":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/issues/8996/comments"},"review_comments":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996/comments"},"review_comment":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/pulls/8996/commits"},"statuses":{"href":"https://api.github.com/repos/PrestaShop/PrestaShop/statuses/eaf6b76648b637034c2e62742203f9a04c45de3d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"michaelKaefer"}}