GitHub PullRequestReviewCommentEvent at 2014-11-26 14:06:36
Repository: MagentoConnectorBundle
Actor: BitOne
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/comments/20936137","id":20936137,"diff_hunk":"@@ -0,0 +1,114 @@\n+<?php\n+\n+namespace Pim\\Bundle\\MagentoConnectorBundle\\Command;\n+\n+use Pim\\Bundle\\MagentoConnectorBundle\\Manager\\MagentoConfigurationManager;\n+use Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand;\n+use Symfony\\Component\\Console\\Input\\InputArgument;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Symfony\\Component\\Validator\\Validator;\n+use Oro\\Bundle\\TranslationBundle\\Translation\\Translator;\n+\n+/**\n+ * This command allows to check validity of a MagentoConfiguration\n+ *\n+ * @author    Willy Mesnage <willy.mesnage@akeneo.com>\n+ * @copyright 2014 Akeneo SAS (http://www.akeneo.com)\n+ * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)\n+ */\n+class TestMagentoConnectionCommand extends ContainerAwareCommand\n+{\n+    /**\n+     * {@inheritdoc}\n+     */\n+    protected function configure()\n+    {\n+        $this\n+            ->setName('magento-connector:connection:test')\n+            ->setDescription('Tests the connection between connector and Magento with the given configuration.')\n+            ->addArgument('configuration_code', InputArgument::REQUIRED, 'Magento configuration code');\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     *\n+     * @return int 0: success; 1: Configuration not found; 2: Error during validation;\n+     */\n+    protected function execute(InputInterface $input, OutputInterface $output)\n+    {\n+        $validator     = $this->getValidator();\n+        $code          = $input->getArgument('configuration_code');\n+        $manager       = $this->getMagentoConfigurationManager();\n+        $configuration = $manager->getMagentoConfigurationByCode($code);\n+        $translator    = $this->getTranslator();\n+\n+        if (null === $configuration) {\n+            $output->writeln(\n+                sprintf('<error>ERROR</error> : Given configuration with code \"%s\" does not exist.', $code)\n+            );\n+            $status = 1;\n+        } else {\n+            $translator->setLocale($this->getDefaultLocale());\n+            $violations = $validator->validate($configuration, ['connection']);\n+\n+            if ($violations->count() !== 0) {\n+                foreach ($violations as $violation) {\n+                    $output->writeln(sprintf('<error>%s</error>', $translator->trans($violation->getMessage())));\n+                    foreach ($violation->getMessageParameters() as $error) {","path":"Command/TestMagentoConnectionCommand.php","position":58,"original_position":58,"commit_id":"e98ec2080fb549f4ae931116d5900cbf728ba279","original_commit_id":"e98ec2080fb549f4ae931116d5900cbf728ba279","user":{"login":"BitOne","id":2151567,"avatar_url":"https://avatars.githubusercontent.com/u/2151567?v=3","gravatar_id":"","url":"https://api.github.com/users/BitOne","html_url":"https://github.com/BitOne","followers_url":"https://api.github.com/users/BitOne/followers","following_url":"https://api.github.com/users/BitOne/following{/other_user}","gists_url":"https://api.github.com/users/BitOne/gists{/gist_id}","starred_url":"https://api.github.com/users/BitOne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BitOne/subscriptions","organizations_url":"https://api.github.com/users/BitOne/orgs","repos_url":"https://api.github.com/users/BitOne/repos","events_url":"https://api.github.com/users/BitOne/events{/privacy}","received_events_url":"https://api.github.com/users/BitOne/received_events","type":"User","site_admin":false},"body":"That's not how messageParameters is supposed to be used.\r\nhttp://api.symfony.com/2.2/Symfony/Component/Validator/ConstraintViolation.html#method_getMessageParameters","created_at":"2014-11-26T14:06:36Z","updated_at":"2014-11-26T14:06:36Z","html_url":"https://github.com/akeneo/MagentoConnectorBundle/pull/275#discussion_r20936137","pull_request_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275","_links":{"self":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/comments/20936137"},"html":{"href":"https://github.com/akeneo/MagentoConnectorBundle/pull/275#discussion_r20936137"},"pull_request":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275"}}},"pull_request":{"url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275","id":24949593,"html_url":"https://github.com/akeneo/MagentoConnectorBundle/pull/275","diff_url":"https://github.com/akeneo/MagentoConnectorBundle/pull/275.diff","patch_url":"https://github.com/akeneo/MagentoConnectorBundle/pull/275.patch","issue_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/275","number":275,"state":"open","locked":false,"title":"Add MagentoConfiguration and a command to check validity of connection","user":{"login":"willy-ahva","id":7206368,"avatar_url":"https://avatars.githubusercontent.com/u/7206368?v=3","gravatar_id":"","url":"https://api.github.com/users/willy-ahva","html_url":"https://github.com/willy-ahva","followers_url":"https://api.github.com/users/willy-ahva/followers","following_url":"https://api.github.com/users/willy-ahva/following{/other_user}","gists_url":"https://api.github.com/users/willy-ahva/gists{/gist_id}","starred_url":"https://api.github.com/users/willy-ahva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willy-ahva/subscriptions","organizations_url":"https://api.github.com/users/willy-ahva/orgs","repos_url":"https://api.github.com/users/willy-ahva/repos","events_url":"https://api.github.com/users/willy-ahva/events{/privacy}","received_events_url":"https://api.github.com/users/willy-ahva/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-24T17:40:47Z","updated_at":"2014-11-26T14:06:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cb701bd0ba2f26453a19d3d381864ce574ca6e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275/commits","review_comments_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275/comments","review_comment_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/275/comments","statuses_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/statuses/e98ec2080fb549f4ae931116d5900cbf728ba279","head":{"label":"akeneo:poc/apiimport2.0","ref":"poc/apiimport2.0","sha":"e98ec2080fb549f4ae931116d5900cbf728ba279","user":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":14501490,"name":"MagentoConnectorBundle","full_name":"akeneo/MagentoConnectorBundle","owner":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akeneo/MagentoConnectorBundle","description":"Akeneo Magento Connector","fork":false,"url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle","forks_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/forks","keys_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/teams","hooks_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/hooks","issue_events_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/events","assignees_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/tags","blobs_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/languages","stargazers_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/stargazers","contributors_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/contributors","subscribers_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/subscribers","subscription_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/subscription","commits_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/merges","archive_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/downloads","issues_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/releases{/id}","created_at":"2013-11-18T18:44:05Z","updated_at":"2014-11-20T14:01:31Z","pushed_at":"2014-11-26T13:52:35Z","git_url":"git://github.com/akeneo/MagentoConnectorBundle.git","ssh_url":"git@github.com:akeneo/MagentoConnectorBundle.git","clone_url":"https://github.com/akeneo/MagentoConnectorBundle.git","svn_url":"https://github.com/akeneo/MagentoConnectorBundle","homepage":"","size":9985,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":34,"forks":16,"open_issues":34,"watchers":33,"default_branch":"master"}},"base":{"label":"akeneo:2.0","ref":"2.0","sha":"c6e12579c19e64f4a73730120bc02ad5fdbf1354","user":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"repo":{"id":14501490,"name":"MagentoConnectorBundle","full_name":"akeneo/MagentoConnectorBundle","owner":{"login":"akeneo","id":2510186,"avatar_url":"https://avatars.githubusercontent.com/u/2510186?v=3","gravatar_id":"","url":"https://api.github.com/users/akeneo","html_url":"https://github.com/akeneo","followers_url":"https://api.github.com/users/akeneo/followers","following_url":"https://api.github.com/users/akeneo/following{/other_user}","gists_url":"https://api.github.com/users/akeneo/gists{/gist_id}","starred_url":"https://api.github.com/users/akeneo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akeneo/subscriptions","organizations_url":"https://api.github.com/users/akeneo/orgs","repos_url":"https://api.github.com/users/akeneo/repos","events_url":"https://api.github.com/users/akeneo/events{/privacy}","received_events_url":"https://api.github.com/users/akeneo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akeneo/MagentoConnectorBundle","description":"Akeneo Magento Connector","fork":false,"url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle","forks_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/forks","keys_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/teams","hooks_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/hooks","issue_events_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/events{/number}","events_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/events","assignees_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/assignees{/user}","branches_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/branches{/branch}","tags_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/tags","blobs_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/languages","stargazers_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/stargazers","contributors_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/contributors","subscribers_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/subscribers","subscription_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/subscription","commits_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/contents/{+path}","compare_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/merges","archive_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/downloads","issues_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues{/number}","pulls_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/labels{/name}","releases_url":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/releases{/id}","created_at":"2013-11-18T18:44:05Z","updated_at":"2014-11-20T14:01:31Z","pushed_at":"2014-11-26T13:52:35Z","git_url":"git://github.com/akeneo/MagentoConnectorBundle.git","ssh_url":"git@github.com:akeneo/MagentoConnectorBundle.git","clone_url":"https://github.com/akeneo/MagentoConnectorBundle.git","svn_url":"https://github.com/akeneo/MagentoConnectorBundle","homepage":"","size":9985,"stargazers_count":33,"watchers_count":33,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":34,"forks":16,"open_issues":34,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275"},"html":{"href":"https://github.com/akeneo/MagentoConnectorBundle/pull/275"},"issue":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/275"},"comments":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/akeneo/MagentoConnectorBundle/statuses/e98ec2080fb549f4ae931116d5900cbf728ba279"}}}}