{"action":"closed","issue":{"url":"https://api.github.com/repos/zendframework/zend-hydrator/issues/8","labels_url":"https://api.github.com/repos/zendframework/zend-hydrator/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/zendframework/zend-hydrator/issues/8/comments","events_url":"https://api.github.com/repos/zendframework/zend-hydrator/issues/8/events","html_url":"https://github.com/zendframework/zend-hydrator/issues/8","id":112677660,"number":8,"title":"allow string name as HydrationInterface::hydrate() second parameter","user":{"login":"marcosh","id":2643972,"avatar_url":"https://avatars.githubusercontent.com/u/2643972?v=3","gravatar_id":"","url":"https://api.github.com/users/marcosh","html_url":"https://github.com/marcosh","followers_url":"https://api.github.com/users/marcosh/followers","following_url":"https://api.github.com/users/marcosh/following{/other_user}","gists_url":"https://api.github.com/users/marcosh/gists{/gist_id}","starred_url":"https://api.github.com/users/marcosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcosh/subscriptions","organizations_url":"https://api.github.com/users/marcosh/orgs","repos_url":"https://api.github.com/users/marcosh/repos","events_url":"https://api.github.com/users/marcosh/events{/privacy}","received_events_url":"https://api.github.com/users/marcosh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-21T20:59:06Z","updated_at":"2015-10-23T08:37:42Z","closed_at":"2015-10-23T08:37:42Z","body":"The docblock above the definition of `hydrate` in the `HydrationInterface` says that the second parameter should be an object.\r\n\r\nThis implies that the second argument must be an object already costructed, that we are going to mutate to make it hydrated.\r\n\r\nI would like to use the hydrator to construct a new object so that I can pass the array values directly to the constructor of my object, in such a way that the object is created already in a valid state and there is no need of mutation to hydate it completely.\r\n\r\nThis would be possible just allowing the second parameter to be a class name, and not a class instance.\r\n\r\nI understand that this would make the hydrator also a factory, but in my opinion the benefits exceed this drawback.\r\n\r\nWhat do you think?"}}