{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/flex/pulls/comments/343410028","pull_request_review_id":313014435,"id":343410028,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM0MzQxMDAyOA==","diff_hunk":"@@ -0,0 +1,109 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.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 Symfony\\Flex\\Command;\n+\n+use Composer\\Command\\BaseCommand;\n+use Composer\\Factory;\n+use Symfony\\Component\\Console\\Input\\InputInterface;\n+use Symfony\\Component\\Console\\Output\\OutputInterface;\n+use Symfony\\Flex\\InformationOperation;\n+use Symfony\\Flex\\Lock;\n+use Symfony\\Flex\\Recipe;\n+\n+class RecipesCommand extends BaseCommand\n+{\n+    /** @var \\Symfony\\Flex\\Flex */\n+    private $flex;\n+\n+    public function __construct(/* cannot be type-hinted */ $flex)\n+    {\n+        $this->flex = $flex;\n+\n+        parent::__construct();\n+    }\n+\n+    protected function configure()\n+    {\n+        $this->setName('symfony:recipes:show')\n+            ->setAliases(['symfony:recipes'])\n+            ->setDescription('Shows information about all available recipes.')\n+        ;\n+    }\n+\n+    protected function execute(InputInterface $input, OutputInterface $output)\n+    {\n+        $locker = $this->getComposer()->getLocker();\n+        $lockData = $locker->getLockData();\n+\n+        // Merge all packages installed\n+        $packages = array_merge($lockData['packages'], $lockData['packages-dev']);\n+\n+        $installedRepo = $this->getComposer()->getRepositoryManager()->getLocalRepository();\n+\n+        $operations = [];\n+        foreach ($packages as $key => $value) {\n+            if (null === $pkg = $installedRepo->findPackage($value['name'], '*')) {\n+                $this->getIO()->writeError(sprintf('<error>Package %s is not installed</error>', $value['name']));\n+\n+                continue;\n+            }\n+\n+            $operations[] = new InformationOperation($pkg);\n+        }\n+\n+        $recipes = $this->flex->fetchRecipes($operations);\n+        ksort($recipes);\n+\n+        if (\\count($recipes) <= 0) {\n+            $this->getIO()->writeError('<error>No recipe found</error>');\n+\n+            return 1;\n+        }\n+\n+        $write = [\n+            '',\n+            '<bg=blue;fg=white>                      </>',\n+            '<bg=blue;fg=white> Recipes available.   </>',\n+            '<bg=blue;fg=white>                      </>',\n+            '',\n+        ];\n+\n+        $symfonyLock = new Lock(getenv('SYMFONY_LOCKFILE') ?: str_replace('composer.json', 'symfony.lock', Factory::getComposerFile()));\n+\n+        /** @var Recipe $recipe */\n+        foreach ($recipes as $name => $recipe) {\n+            $lockRef = $symfonyLock->get($name)['recipe']['ref'] ?? null;\n+\n+            $additional = '';\n+            if ($recipe->isAuto()) {\n+                $additional = '<comment>(auto recipe)</comment>';\n+            } elseif (null === $lockRef && null !== $recipe->getRef()) {\n+                $additional = '<comment>(new recipe available)</comment>';\n+            } elseif ($recipe->getRef() !== $lockRef) {\n+                $additional = '<comment>(update available)</comment>';\n+            }\n+            $write[] = sprintf(' * %s %s', $name, $additional);\n+        }\n+\n+        // TODO : Uncomment the lines following the implemented features\n+        //$write[] = '';\n+        //$write[] = '<fg=blue>Run</>:';\n+        //$write[] = ' * composer symfony:recipes vendor/package to see details about a recipe.';\n+        //$write[] = ' * composer symfony:recipes:update vendor/package to update that recipe.';","path":"src/Command/RecipesCommand.php","position":101,"original_position":101,"commit_id":"f26a79a1f9d396bd06206d9ade3913f7861a01ec","original_commit_id":"f26a79a1f9d396bd06206d9ade3913f7861a01ec","user":{"login":"weaverryan","id":121003,"node_id":"MDQ6VXNlcjEyMTAwMw==","avatar_url":"https://avatars1.githubusercontent.com/u/121003?v=4","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"body":"I think to make this new command \"complete\", we would need to at least be able to show 2 commands down here:\r\n\r\nA) A command to \"update\" a single recipe - so `symfony:recipe:update` - item (3) from #518 \r\nB) A command to \"install\" missing recipes - so `symfony:recipe:install` - item (2) from #518 \r\n\r\nThe `symfony:recipes vendor/package` or whatever we call it - item (4) from #518 would be super nice to have, as would `symfony:recipes:blame` - but those could come later.","created_at":"2019-11-07T01:19:42Z","updated_at":"2019-11-07T01:19:42Z","html_url":"https://github.com/symfony/flex/pull/562#discussion_r343410028","pull_request_url":"https://api.github.com/repos/symfony/flex/pulls/562","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/symfony/flex/pulls/comments/343410028"},"html":{"href":"https://github.com/symfony/flex/pull/562#discussion_r343410028"},"pull_request":{"href":"https://api.github.com/repos/symfony/flex/pulls/562"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/flex/pulls/562","id":318845770,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE4ODQ1Nzcw","html_url":"https://github.com/symfony/flex/pull/562","diff_url":"https://github.com/symfony/flex/pull/562.diff","patch_url":"https://github.com/symfony/flex/pull/562.patch","issue_url":"https://api.github.com/repos/symfony/flex/issues/562","number":562,"state":"open","locked":false,"title":"[DX] Command to list all available recipes","user":{"login":"maxhelias","id":12966574,"node_id":"MDQ6VXNlcjEyOTY2NTc0","avatar_url":"https://avatars2.githubusercontent.com/u/12966574?v=4","gravatar_id":"","url":"https://api.github.com/users/maxhelias","html_url":"https://github.com/maxhelias","followers_url":"https://api.github.com/users/maxhelias/followers","following_url":"https://api.github.com/users/maxhelias/following{/other_user}","gists_url":"https://api.github.com/users/maxhelias/gists{/gist_id}","starred_url":"https://api.github.com/users/maxhelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxhelias/subscriptions","organizations_url":"https://api.github.com/users/maxhelias/orgs","repos_url":"https://api.github.com/users/maxhelias/repos","events_url":"https://api.github.com/users/maxhelias/events{/privacy}","received_events_url":"https://api.github.com/users/maxhelias/received_events","type":"User","site_admin":false},"body":"First step of #518, the command `symfony:recipes:show` and alias `symfony:recipes`\r\n\r\nResult :\r\n<img width=\"701\" alt=\"Capture d’écran 2019-09-18 à 15 46 09\" src=\"https://user-images.githubusercontent.com/12966574/65157259-c468d200-da30-11e9-87c5-e583f5821e03.png\">\r\n\r\nI need feedback on the disposition and maybe i can add the version of the recipe installed like\r\n - doctrine/annontations 1.0\r\n\r\nTell me what you think :) \r\n\r\nNote: the last section is currently commented out, and will be added later","created_at":"2019-09-18T14:33:26Z","updated_at":"2019-11-07T01:19:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aeb4e4367b5da174ee6d54589149a7b191896784","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/symfony/flex/pulls/562/commits","review_comments_url":"https://api.github.com/repos/symfony/flex/pulls/562/comments","review_comment_url":"https://api.github.com/repos/symfony/flex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/flex/issues/562/comments","statuses_url":"https://api.github.com/repos/symfony/flex/statuses/f26a79a1f9d396bd06206d9ade3913f7861a01ec","head":{"label":"maxhelias:feature/recipe-list","ref":"feature/recipe-list","sha":"f26a79a1f9d396bd06206d9ade3913f7861a01ec","user":{"login":"maxhelias","id":12966574,"node_id":"MDQ6VXNlcjEyOTY2NTc0","avatar_url":"https://avatars2.githubusercontent.com/u/12966574?v=4","gravatar_id":"","url":"https://api.github.com/users/maxhelias","html_url":"https://github.com/maxhelias","followers_url":"https://api.github.com/users/maxhelias/followers","following_url":"https://api.github.com/users/maxhelias/following{/other_user}","gists_url":"https://api.github.com/users/maxhelias/gists{/gist_id}","starred_url":"https://api.github.com/users/maxhelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxhelias/subscriptions","organizations_url":"https://api.github.com/users/maxhelias/orgs","repos_url":"https://api.github.com/users/maxhelias/repos","events_url":"https://api.github.com/users/maxhelias/events{/privacy}","received_events_url":"https://api.github.com/users/maxhelias/received_events","type":"User","site_admin":false},"repo":{"id":138884961,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg4ODQ5NjE=","name":"flex","full_name":"maxhelias/flex","private":false,"owner":{"login":"maxhelias","id":12966574,"node_id":"MDQ6VXNlcjEyOTY2NTc0","avatar_url":"https://avatars2.githubusercontent.com/u/12966574?v=4","gravatar_id":"","url":"https://api.github.com/users/maxhelias","html_url":"https://github.com/maxhelias","followers_url":"https://api.github.com/users/maxhelias/followers","following_url":"https://api.github.com/users/maxhelias/following{/other_user}","gists_url":"https://api.github.com/users/maxhelias/gists{/gist_id}","starred_url":"https://api.github.com/users/maxhelias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxhelias/subscriptions","organizations_url":"https://api.github.com/users/maxhelias/orgs","repos_url":"https://api.github.com/users/maxhelias/repos","events_url":"https://api.github.com/users/maxhelias/events{/privacy}","received_events_url":"https://api.github.com/users/maxhelias/received_events","type":"User","site_admin":false},"html_url":"https://github.com/maxhelias/flex","description":"Composer plugin for Symfony","fork":true,"url":"https://api.github.com/repos/maxhelias/flex","forks_url":"https://api.github.com/repos/maxhelias/flex/forks","keys_url":"https://api.github.com/repos/maxhelias/flex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxhelias/flex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxhelias/flex/teams","hooks_url":"https://api.github.com/repos/maxhelias/flex/hooks","issue_events_url":"https://api.github.com/repos/maxhelias/flex/issues/events{/number}","events_url":"https://api.github.com/repos/maxhelias/flex/events","assignees_url":"https://api.github.com/repos/maxhelias/flex/assignees{/user}","branches_url":"https://api.github.com/repos/maxhelias/flex/branches{/branch}","tags_url":"https://api.github.com/repos/maxhelias/flex/tags","blobs_url":"https://api.github.com/repos/maxhelias/flex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxhelias/flex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxhelias/flex/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxhelias/flex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxhelias/flex/statuses/{sha}","languages_url":"https://api.github.com/repos/maxhelias/flex/languages","stargazers_url":"https://api.github.com/repos/maxhelias/flex/stargazers","contributors_url":"https://api.github.com/repos/maxhelias/flex/contributors","subscribers_url":"https://api.github.com/repos/maxhelias/flex/subscribers","subscription_url":"https://api.github.com/repos/maxhelias/flex/subscription","commits_url":"https://api.github.com/repos/maxhelias/flex/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxhelias/flex/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxhelias/flex/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxhelias/flex/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxhelias/flex/contents/{+path}","compare_url":"https://api.github.com/repos/maxhelias/flex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxhelias/flex/merges","archive_url":"https://api.github.com/repos/maxhelias/flex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxhelias/flex/downloads","issues_url":"https://api.github.com/repos/maxhelias/flex/issues{/number}","pulls_url":"https://api.github.com/repos/maxhelias/flex/pulls{/number}","milestones_url":"https://api.github.com/repos/maxhelias/flex/milestones{/number}","notifications_url":"https://api.github.com/repos/maxhelias/flex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxhelias/flex/labels{/name}","releases_url":"https://api.github.com/repos/maxhelias/flex/releases{/id}","deployments_url":"https://api.github.com/repos/maxhelias/flex/deployments","created_at":"2018-06-27T13:24:34Z","updated_at":"2019-10-14T14:49:49Z","pushed_at":"2019-10-15T08:06:37Z","git_url":"git://github.com/maxhelias/flex.git","ssh_url":"git@github.com:maxhelias/flex.git","clone_url":"https://github.com/maxhelias/flex.git","svn_url":"https://github.com/maxhelias/flex","homepage":"https://symfony.sh/","size":651,"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,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"133e649fdf08aeb8741be1ba955ccbe5cd17c696","user":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":70288750,"node_id":"MDEwOlJlcG9zaXRvcnk3MDI4ODc1MA==","name":"flex","full_name":"symfony/flex","private":false,"owner":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/symfony/flex","description":"Composer plugin for Symfony","fork":false,"url":"https://api.github.com/repos/symfony/flex","forks_url":"https://api.github.com/repos/symfony/flex/forks","keys_url":"https://api.github.com/repos/symfony/flex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/flex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/flex/teams","hooks_url":"https://api.github.com/repos/symfony/flex/hooks","issue_events_url":"https://api.github.com/repos/symfony/flex/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/flex/events","assignees_url":"https://api.github.com/repos/symfony/flex/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/flex/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/flex/tags","blobs_url":"https://api.github.com/repos/symfony/flex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/flex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/flex/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/flex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/flex/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/flex/languages","stargazers_url":"https://api.github.com/repos/symfony/flex/stargazers","contributors_url":"https://api.github.com/repos/symfony/flex/contributors","subscribers_url":"https://api.github.com/repos/symfony/flex/subscribers","subscription_url":"https://api.github.com/repos/symfony/flex/subscription","commits_url":"https://api.github.com/repos/symfony/flex/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/flex/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/flex/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/flex/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/flex/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/flex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/flex/merges","archive_url":"https://api.github.com/repos/symfony/flex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/flex/downloads","issues_url":"https://api.github.com/repos/symfony/flex/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/flex/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/flex/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/flex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/flex/labels{/name}","releases_url":"https://api.github.com/repos/symfony/flex/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/flex/deployments","created_at":"2016-10-07T23:01:10Z","updated_at":"2019-11-06T19:48:33Z","pushed_at":"2019-10-15T08:06:38Z","git_url":"git://github.com/symfony/flex.git","ssh_url":"git@github.com:symfony/flex.git","clone_url":"https://github.com/symfony/flex.git","svn_url":"https://github.com/symfony/flex","homepage":"https://flex.symfony.com/","size":678,"stargazers_count":2735,"watchers_count":2735,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":115,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":38,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":115,"open_issues":38,"watchers":2735,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/flex/pulls/562"},"html":{"href":"https://github.com/symfony/flex/pull/562"},"issue":{"href":"https://api.github.com/repos/symfony/flex/issues/562"},"comments":{"href":"https://api.github.com/repos/symfony/flex/issues/562/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/flex/pulls/562/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/flex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/flex/pulls/562/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/flex/statuses/f26a79a1f9d396bd06206d9ade3913f7861a01ec"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"weaverryan"}}