{"action":"created","comment":{"url":"https://api.github.com/repos/api-platform/core/pulls/comments/173740068","pull_request_review_id":102976583,"id":173740068,"diff_hunk":"@@ -0,0 +1,87 @@\n+<?php\n+\n+/*\n+ * This file is part of the API Platform project.\n+ *\n+ * (c) Kévin Dunglas <dunglas@gmail.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+declare(strict_types=1);\n+\n+namespace ApiPlatform\\Core\\Metadata\\Property\\Factory;\n+\n+use ApiPlatform\\Core\\Api\\OperationMethodResolverInterface;\n+use ApiPlatform\\Core\\Exception\\PropertyNotFoundException;\n+use ApiPlatform\\Core\\Exception\\RuntimeException;\n+use ApiPlatform\\Core\\Metadata\\Property\\PropertyMetadata;\n+\n+/**\n+ * Set properties available in the constructor as writable.\n+ *\n+ * @author Maxime Veber <maxime.veber@nekland.fr>\n+ */\n+final class ConstructorPropertyMetadataFactory implements PropertyMetadataFactoryInterface\n+{\n+    /**\n+     * @var PropertyMetadataFactoryInterface\n+     */\n+    private $decorated;\n+\n+    /**\n+     * @var OperationMethodResolverInterface\n+     */\n+    private $operationMethodResolver;\n+\n+    public function __construct(OperationMethodResolverInterface $operationMethodResolver, PropertyMetadataFactoryInterface $decorated = null)","path":"src/Metadata/Property/Factory/ConstructorPropertyMetadataFactory.php","position":38,"original_position":38,"commit_id":"c0bbcaf09d5fcbadd689dd1d6928852b4b9d78be","original_commit_id":"c0bbcaf09d5fcbadd689dd1d6928852b4b9d78be","user":{"login":"Taluu","id":239685,"avatar_url":"https://avatars3.githubusercontent.com/u/239685?v=4","gravatar_id":"","url":"https://api.github.com/users/Taluu","html_url":"https://github.com/Taluu","followers_url":"https://api.github.com/users/Taluu/followers","following_url":"https://api.github.com/users/Taluu/following{/other_user}","gists_url":"https://api.github.com/users/Taluu/gists{/gist_id}","starred_url":"https://api.github.com/users/Taluu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taluu/subscriptions","organizations_url":"https://api.github.com/users/Taluu/orgs","repos_url":"https://api.github.com/users/Taluu/repos","events_url":"https://api.github.com/users/Taluu/events{/privacy}","received_events_url":"https://api.github.com/users/Taluu/received_events","type":"User","site_admin":false},"body":"IMO it's either you decorate something or you don't, Not both at the same time (S from Solid, anyone ?).\r\n\r\nHaving a basic decorator that just returns a `new PropertyMetadata()` would be simpler.","created_at":"2018-03-12T09:54:53Z","updated_at":"2018-03-12T09:54:53Z","html_url":"https://github.com/api-platform/core/pull/1749#discussion_r173740068","pull_request_url":"https://api.github.com/repos/api-platform/core/pulls/1749","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments/173740068"},"html":{"href":"https://github.com/api-platform/core/pull/1749#discussion_r173740068"},"pull_request":{"href":"https://api.github.com/repos/api-platform/core/pulls/1749"}},"in_reply_to_id":173615599},"pull_request":{"url":"https://api.github.com/repos/api-platform/core/pulls/1749","id":172916473,"html_url":"https://github.com/api-platform/core/pull/1749","diff_url":"https://github.com/api-platform/core/pull/1749.diff","patch_url":"https://github.com/api-platform/core/pull/1749.patch","issue_url":"https://api.github.com/repos/api-platform/core/issues/1749","number":1749,"state":"open","locked":false,"title":"Make resource constructor parameters writables","user":{"login":"Nek-","id":972456,"avatar_url":"https://avatars1.githubusercontent.com/u/972456?v=4","gravatar_id":"","url":"https://api.github.com/users/Nek-","html_url":"https://github.com/Nek-","followers_url":"https://api.github.com/users/Nek-/followers","following_url":"https://api.github.com/users/Nek-/following{/other_user}","gists_url":"https://api.github.com/users/Nek-/gists{/gist_id}","starred_url":"https://api.github.com/users/Nek-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nek-/subscriptions","organizations_url":"https://api.github.com/users/Nek-/orgs","repos_url":"https://api.github.com/users/Nek-/repos","events_url":"https://api.github.com/users/Nek-/events{/privacy}","received_events_url":"https://api.github.com/users/Nek-/received_events","type":"User","site_admin":false},"body":"This is motivated because other tools are already constructor friendly (ie Symfony serializer and Doctrine).\r\n\r\nAlso using constructors must be recommended and not supporting them is a serious feature missing.\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | somehow\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | https://github.com/api-platform/core/issues/1747\r\n| License       | MIT\r\n| Doc PR        | N/A\r\n\r\n","created_at":"2018-03-05T16:25:21Z","updated_at":"2018-03-12T09:54:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a38a35f4431f59c724a3bcadbdbc066180a2536c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/api-platform/core/pulls/1749/commits","review_comments_url":"https://api.github.com/repos/api-platform/core/pulls/1749/comments","review_comment_url":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/api-platform/core/issues/1749/comments","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/c0bbcaf09d5fcbadd689dd1d6928852b4b9d78be","head":{"label":"Nek-:feature/make-constructor-parameters-writable","ref":"feature/make-constructor-parameters-writable","sha":"c0bbcaf09d5fcbadd689dd1d6928852b4b9d78be","user":{"login":"Nek-","id":972456,"avatar_url":"https://avatars1.githubusercontent.com/u/972456?v=4","gravatar_id":"","url":"https://api.github.com/users/Nek-","html_url":"https://github.com/Nek-","followers_url":"https://api.github.com/users/Nek-/followers","following_url":"https://api.github.com/users/Nek-/following{/other_user}","gists_url":"https://api.github.com/users/Nek-/gists{/gist_id}","starred_url":"https://api.github.com/users/Nek-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nek-/subscriptions","organizations_url":"https://api.github.com/users/Nek-/orgs","repos_url":"https://api.github.com/users/Nek-/repos","events_url":"https://api.github.com/users/Nek-/events{/privacy}","received_events_url":"https://api.github.com/users/Nek-/received_events","type":"User","site_admin":false},"repo":{"id":112630993,"name":"core","full_name":"Nek-/core","owner":{"login":"Nek-","id":972456,"avatar_url":"https://avatars1.githubusercontent.com/u/972456?v=4","gravatar_id":"","url":"https://api.github.com/users/Nek-","html_url":"https://github.com/Nek-","followers_url":"https://api.github.com/users/Nek-/followers","following_url":"https://api.github.com/users/Nek-/following{/other_user}","gists_url":"https://api.github.com/users/Nek-/gists{/gist_id}","starred_url":"https://api.github.com/users/Nek-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nek-/subscriptions","organizations_url":"https://api.github.com/users/Nek-/orgs","repos_url":"https://api.github.com/users/Nek-/repos","events_url":"https://api.github.com/users/Nek-/events{/privacy}","received_events_url":"https://api.github.com/users/Nek-/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Nek-/core","description":"The server component of API Platform: hypermedia and GraphQL APIs in minutes","fork":true,"url":"https://api.github.com/repos/Nek-/core","forks_url":"https://api.github.com/repos/Nek-/core/forks","keys_url":"https://api.github.com/repos/Nek-/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nek-/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nek-/core/teams","hooks_url":"https://api.github.com/repos/Nek-/core/hooks","issue_events_url":"https://api.github.com/repos/Nek-/core/issues/events{/number}","events_url":"https://api.github.com/repos/Nek-/core/events","assignees_url":"https://api.github.com/repos/Nek-/core/assignees{/user}","branches_url":"https://api.github.com/repos/Nek-/core/branches{/branch}","tags_url":"https://api.github.com/repos/Nek-/core/tags","blobs_url":"https://api.github.com/repos/Nek-/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nek-/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nek-/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nek-/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nek-/core/statuses/{sha}","languages_url":"https://api.github.com/repos/Nek-/core/languages","stargazers_url":"https://api.github.com/repos/Nek-/core/stargazers","contributors_url":"https://api.github.com/repos/Nek-/core/contributors","subscribers_url":"https://api.github.com/repos/Nek-/core/subscribers","subscription_url":"https://api.github.com/repos/Nek-/core/subscription","commits_url":"https://api.github.com/repos/Nek-/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nek-/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nek-/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nek-/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nek-/core/contents/{+path}","compare_url":"https://api.github.com/repos/Nek-/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nek-/core/merges","archive_url":"https://api.github.com/repos/Nek-/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nek-/core/downloads","issues_url":"https://api.github.com/repos/Nek-/core/issues{/number}","pulls_url":"https://api.github.com/repos/Nek-/core/pulls{/number}","milestones_url":"https://api.github.com/repos/Nek-/core/milestones{/number}","notifications_url":"https://api.github.com/repos/Nek-/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nek-/core/labels{/name}","releases_url":"https://api.github.com/repos/Nek-/core/releases{/id}","deployments_url":"https://api.github.com/repos/Nek-/core/deployments","created_at":"2017-11-30T15:59:56Z","updated_at":"2017-11-30T15:59:59Z","pushed_at":"2018-03-07T17:14:09Z","git_url":"git://github.com/Nek-/core.git","ssh_url":"git@github.com:Nek-/core.git","clone_url":"https://github.com/Nek-/core.git","svn_url":"https://github.com/Nek-/core","homepage":"https://api-platform.com","size":7629,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"master"}},"base":{"label":"api-platform:master","ref":"master","sha":"9ea5d376eaa279ba5a02e88a5c62c999b3fc4b7c","user":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars3.githubusercontent.com/u/13420081?v=4","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":29501260,"name":"core","full_name":"api-platform/core","owner":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars3.githubusercontent.com/u/13420081?v=4","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/api-platform/core","description":"The server component of API Platform: hypermedia and GraphQL APIs in minutes","fork":false,"url":"https://api.github.com/repos/api-platform/core","forks_url":"https://api.github.com/repos/api-platform/core/forks","keys_url":"https://api.github.com/repos/api-platform/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/api-platform/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/api-platform/core/teams","hooks_url":"https://api.github.com/repos/api-platform/core/hooks","issue_events_url":"https://api.github.com/repos/api-platform/core/issues/events{/number}","events_url":"https://api.github.com/repos/api-platform/core/events","assignees_url":"https://api.github.com/repos/api-platform/core/assignees{/user}","branches_url":"https://api.github.com/repos/api-platform/core/branches{/branch}","tags_url":"https://api.github.com/repos/api-platform/core/tags","blobs_url":"https://api.github.com/repos/api-platform/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/api-platform/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/api-platform/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/api-platform/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/{sha}","languages_url":"https://api.github.com/repos/api-platform/core/languages","stargazers_url":"https://api.github.com/repos/api-platform/core/stargazers","contributors_url":"https://api.github.com/repos/api-platform/core/contributors","subscribers_url":"https://api.github.com/repos/api-platform/core/subscribers","subscription_url":"https://api.github.com/repos/api-platform/core/subscription","commits_url":"https://api.github.com/repos/api-platform/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/api-platform/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/api-platform/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/api-platform/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/api-platform/core/contents/{+path}","compare_url":"https://api.github.com/repos/api-platform/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/api-platform/core/merges","archive_url":"https://api.github.com/repos/api-platform/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/api-platform/core/downloads","issues_url":"https://api.github.com/repos/api-platform/core/issues{/number}","pulls_url":"https://api.github.com/repos/api-platform/core/pulls{/number}","milestones_url":"https://api.github.com/repos/api-platform/core/milestones{/number}","notifications_url":"https://api.github.com/repos/api-platform/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/api-platform/core/labels{/name}","releases_url":"https://api.github.com/repos/api-platform/core/releases{/id}","deployments_url":"https://api.github.com/repos/api-platform/core/deployments","created_at":"2015-01-19T23:05:56Z","updated_at":"2018-03-11T18:49:15Z","pushed_at":"2018-03-09T16:48:11Z","git_url":"git://github.com/api-platform/core.git","ssh_url":"git@github.com:api-platform/core.git","clone_url":"https://github.com/api-platform/core.git","svn_url":"https://github.com/api-platform/core","homepage":"https://api-platform.com","size":7673,"stargazers_count":641,"watchers_count":641,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":214,"mirror_url":null,"archived":false,"open_issues_count":215,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":214,"open_issues":215,"watchers":641,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/1749"},"html":{"href":"https://github.com/api-platform/core/pull/1749"},"issue":{"href":"https://api.github.com/repos/api-platform/core/issues/1749"},"comments":{"href":"https://api.github.com/repos/api-platform/core/issues/1749/comments"},"review_comments":{"href":"https://api.github.com/repos/api-platform/core/pulls/1749/comments"},"review_comment":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/api-platform/core/pulls/1749/commits"},"statuses":{"href":"https://api.github.com/repos/api-platform/core/statuses/c0bbcaf09d5fcbadd689dd1d6928852b4b9d78be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Taluu"}}