{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/uploads/issues/3","labels_url":"https://api.github.com/repos/thephpleague/uploads/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/uploads/issues/3/comments","events_url":"https://api.github.com/repos/thephpleague/uploads/issues/3/events","html_url":"https://github.com/thephpleague/uploads/issues/3","id":60109278,"number":3,"title":"Decoupling UploadedFile from $_FILES","user":{"login":"nyamsprod","id":51073,"avatar_url":"https://avatars.githubusercontent.com/u/51073?v=3","gravatar_id":"","url":"https://api.github.com/users/nyamsprod","html_url":"https://github.com/nyamsprod","followers_url":"https://api.github.com/users/nyamsprod/followers","following_url":"https://api.github.com/users/nyamsprod/following{/other_user}","gists_url":"https://api.github.com/users/nyamsprod/gists{/gist_id}","starred_url":"https://api.github.com/users/nyamsprod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyamsprod/subscriptions","organizations_url":"https://api.github.com/users/nyamsprod/orgs","repos_url":"https://api.github.com/users/nyamsprod/repos","events_url":"https://api.github.com/users/nyamsprod/events{/privacy}","received_events_url":"https://api.github.com/users/nyamsprod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T14:36:50Z","updated_at":"2015-03-06T15:58:44Z","closed_at":null,"body":"`$_FILES` is made available inside the class when using `UploadedFile::createFromGlobals`. I would prefer having the `$_FILES` array in the method signature like what I did in the [league\\Url](https://github.com/thephpleague/url/blob/master/src/Traits/Factory.php#L78) package. \r\n\r\nThat way:\r\n- the package in itself is not bound to any PHP global variable\r\n- mocking is made more easy\r\n\r\nSo having `UploadedFile::createFromGlobals(array $files, $name)` instead would be great. \r\nPeople may complain on the argument order but that another debate :) \r\n"},"comment":{"url":"https://api.github.com/repos/thephpleague/uploads/issues/comments/77582436","html_url":"https://github.com/thephpleague/uploads/issues/3#issuecomment-77582436","issue_url":"https://api.github.com/repos/thephpleague/uploads/issues/3","id":77582436,"user":{"login":"codeguy","id":31677,"avatar_url":"https://avatars.githubusercontent.com/u/31677?v=3","gravatar_id":"","url":"https://api.github.com/users/codeguy","html_url":"https://github.com/codeguy","followers_url":"https://api.github.com/users/codeguy/followers","following_url":"https://api.github.com/users/codeguy/following{/other_user}","gists_url":"https://api.github.com/users/codeguy/gists{/gist_id}","starred_url":"https://api.github.com/users/codeguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeguy/subscriptions","organizations_url":"https://api.github.com/users/codeguy/orgs","repos_url":"https://api.github.com/users/codeguy/repos","events_url":"https://api.github.com/users/codeguy/events{/privacy}","received_events_url":"https://api.github.com/users/codeguy/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T15:58:44Z","updated_at":"2015-03-06T15:58:44Z","body":"I think this better decouples the data source from the `UploadedFile`, but it adds an extra step for the end user. The end user must instantiate her own DataSource instance if even she will be using the global `$_FILES` data. Is this necessary?"}}