{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments/39427363","id":39427363,"diff_hunk":"@@ -0,0 +1,69 @@\n+<?php\n+\n+/*\n+ * This file is part of the FOSRestBundle package.\n+ *\n+ * (c) FriendsOfSymfony <http://friendsofsymfony.github.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 FOS\\RestBundle\\Controller\\Annotations;\n+\n+use Symfony\\Component\\Validator\\Constraint;\n+use Symfony\\Component\\Validator\\Constraints;\n+\n+/**\n+ * {@inheritdoc}\n+ *\n+ * @author Ener-Getick <egetick@gmail.Com>\n+ */\n+abstract class AbstractScalarParam extends AbstractParam\n+{\n+    /** @var scalar|array|Constraint|null */\n+    public $requirements = null;\n+    /** @var bool */\n+    public $array = false;\n+    /** @var bool */\n+    public $allowBlank = true;\n+\n+    /** {@inheritdoc} */\n+    public function getConstraints() {","path":"Controller/Annotations/AbstractScalarParam.php","position":32,"original_position":32,"commit_id":"8308b484b713a357d1d7ebf2934ab2d19e13697d","original_commit_id":"8308b484b713a357d1d7ebf2934ab2d19e13697d","user":{"login":"lsmith77","id":300279,"avatar_url":"https://avatars.githubusercontent.com/u/300279?v=3","gravatar_id":"","url":"https://api.github.com/users/lsmith77","html_url":"https://github.com/lsmith77","followers_url":"https://api.github.com/users/lsmith77/followers","following_url":"https://api.github.com/users/lsmith77/following{/other_user}","gists_url":"https://api.github.com/users/lsmith77/gists{/gist_id}","starred_url":"https://api.github.com/users/lsmith77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsmith77/subscriptions","organizations_url":"https://api.github.com/users/lsmith77/orgs","repos_url":"https://api.github.com/users/lsmith77/repos","events_url":"https://api.github.com/users/lsmith77/events{/privacy}","received_events_url":"https://api.github.com/users/lsmith77/received_events","type":"User","site_admin":false},"body":"``{`` needs to be on the next line","created_at":"2015-09-14T18:16:46Z","updated_at":"2015-09-14T18:16:46Z","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097#discussion_r39427363","pull_request_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments/39427363"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097#discussion_r39427363"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097","id":42695571,"html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097","diff_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097.diff","patch_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097.patch","issue_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1097","number":1097,"state":"open","locked":false,"title":"Add file uploads support","user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"body":"This PR add file uploads support. (#793)\r\nCurrently, there are no requirements supported.\r\n\r\n ```php\r\n<?php\r\n\r\nuse FOS\\RestBundle\\Controller\\Annotations\\QueryParam;\r\n\r\n/**\r\n * @FileParam(\r\n *   name=\"foo_file\",\r\n *   key=null,\r\n *   incompatibles={},\r\n *   default=null,\r\n *   description=\"\",\r\n *   strict=false,\r\n *   nullable=false,\r\n *   requirements={},\r\n *   image=false\r\n * )\r\n */\r\n```\r\n\r\nI moved the scalar constraints (notBlank, array) in another abstract class ``ScalarParam``, I don't know if this is a really good name ...\r\n\r\nThe ``requirements`` parameter of ``@FileParam`` must be a constraint or an array that can contain all the fields of http://symfony.com/doc/current/reference/constraints/File.html or http://symfony.com/doc/current/reference/constraints/Image.html. It depends of the ``image`` parameter.\r\n","created_at":"2015-08-18T13:03:06Z","updated_at":"2015-09-14T18:16:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f90a6991e5a1377180cc8085e3fedb16878a0092","assignee":null,"milestone":{"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones/5","html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle/milestones/2.0","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones/5/labels","id":954486,"number":5,"title":"2.0","description":"","creator":{"login":"lsmith77","id":300279,"avatar_url":"https://avatars.githubusercontent.com/u/300279?v=3","gravatar_id":"","url":"https://api.github.com/users/lsmith77","html_url":"https://github.com/lsmith77","followers_url":"https://api.github.com/users/lsmith77/followers","following_url":"https://api.github.com/users/lsmith77/following{/other_user}","gists_url":"https://api.github.com/users/lsmith77/gists{/gist_id}","starred_url":"https://api.github.com/users/lsmith77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsmith77/subscriptions","organizations_url":"https://api.github.com/users/lsmith77/orgs","repos_url":"https://api.github.com/users/lsmith77/repos","events_url":"https://api.github.com/users/lsmith77/events{/privacy}","received_events_url":"https://api.github.com/users/lsmith77/received_events","type":"User","site_admin":false},"open_issues":54,"closed_issues":11,"state":"open","created_at":"2015-01-28T08:04:14Z","updated_at":"2015-09-13T15:54:47Z","due_on":"2015-11-29T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097/commits","review_comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097/comments","review_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1097/comments","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/8308b484b713a357d1d7ebf2934ab2d19e13697d","head":{"label":"Ener-Getick:ISSUE_793","ref":"ISSUE_793","sha":"8308b484b713a357d1d7ebf2934ab2d19e13697d","user":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"repo":{"id":37521946,"name":"FOSRestBundle","full_name":"Ener-Getick/FOSRestBundle","owner":{"login":"Ener-Getick","id":6871899,"avatar_url":"https://avatars.githubusercontent.com/u/6871899?v=3","gravatar_id":"","url":"https://api.github.com/users/Ener-Getick","html_url":"https://github.com/Ener-Getick","followers_url":"https://api.github.com/users/Ener-Getick/followers","following_url":"https://api.github.com/users/Ener-Getick/following{/other_user}","gists_url":"https://api.github.com/users/Ener-Getick/gists{/gist_id}","starred_url":"https://api.github.com/users/Ener-Getick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ener-Getick/subscriptions","organizations_url":"https://api.github.com/users/Ener-Getick/orgs","repos_url":"https://api.github.com/users/Ener-Getick/repos","events_url":"https://api.github.com/users/Ener-Getick/events{/privacy}","received_events_url":"https://api.github.com/users/Ener-Getick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ener-Getick/FOSRestBundle","description":"This Bundle provides various tools to rapidly develop RESTful API's with Symfony2","fork":true,"url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle","forks_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/forks","keys_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/teams","hooks_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/hooks","issue_events_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues/events{/number}","events_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/events","assignees_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/assignees{/user}","branches_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/branches{/branch}","tags_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/tags","blobs_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/languages","stargazers_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/stargazers","contributors_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/contributors","subscribers_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/subscribers","subscription_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/subscription","commits_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/contents/{+path}","compare_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/merges","archive_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/downloads","issues_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/issues{/number}","pulls_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/labels{/name}","releases_url":"https://api.github.com/repos/Ener-Getick/FOSRestBundle/releases{/id}","created_at":"2015-06-16T09:50:51Z","updated_at":"2015-06-16T09:50:51Z","pushed_at":"2015-09-14T16:27:07Z","git_url":"git://github.com/Ener-Getick/FOSRestBundle.git","ssh_url":"git@github.com:Ener-Getick/FOSRestBundle.git","clone_url":"https://github.com/Ener-Getick/FOSRestBundle.git","svn_url":"https://github.com/Ener-Getick/FOSRestBundle","homepage":"http://friendsofsymfony.github.com/","size":3216,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"FriendsOfSymfony:master","ref":"master","sha":"77c217d119195539634fa4fe552c7230598942f1","user":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars.githubusercontent.com/u/529709?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"repo":{"id":1509011,"name":"FOSRestBundle","full_name":"FriendsOfSymfony/FOSRestBundle","owner":{"login":"FriendsOfSymfony","id":529709,"avatar_url":"https://avatars.githubusercontent.com/u/529709?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfSymfony","html_url":"https://github.com/FriendsOfSymfony","followers_url":"https://api.github.com/users/FriendsOfSymfony/followers","following_url":"https://api.github.com/users/FriendsOfSymfony/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfSymfony/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfSymfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfSymfony/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfSymfony/orgs","repos_url":"https://api.github.com/users/FriendsOfSymfony/repos","events_url":"https://api.github.com/users/FriendsOfSymfony/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfSymfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfSymfony/FOSRestBundle","description":"This Bundle provides various tools to rapidly develop RESTful API's with Symfony2","fork":false,"url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle","forks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/forks","keys_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/teams","hooks_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/events","assignees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/tags","blobs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/languages","stargazers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/subscription","commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/merges","archive_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/downloads","issues_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/releases{/id}","created_at":"2011-03-21T23:14:13Z","updated_at":"2015-09-14T16:39:24Z","pushed_at":"2015-09-14T16:27:09Z","git_url":"git://github.com/FriendsOfSymfony/FOSRestBundle.git","ssh_url":"git@github.com:FriendsOfSymfony/FOSRestBundle.git","clone_url":"https://github.com/FriendsOfSymfony/FOSRestBundle.git","svn_url":"https://github.com/FriendsOfSymfony/FOSRestBundle","homepage":"http://friendsofsymfony.github.com/","size":6301,"stargazers_count":1206,"watchers_count":1206,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":470,"mirror_url":null,"open_issues_count":63,"forks":470,"open_issues":63,"watchers":1206,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097"},"html":{"href":"https://github.com/FriendsOfSymfony/FOSRestBundle/pull/1097"},"issue":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1097"},"comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/issues/1097/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/pulls/1097/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfSymfony/FOSRestBundle/statuses/8308b484b713a357d1d7ebf2934ab2d19e13697d"}}}}