{"action":"created","issue":{"url":"https://api.github.com/repos/phpspec/phpspec/issues/754","labels_url":"https://api.github.com/repos/phpspec/phpspec/issues/754/labels{/name}","comments_url":"https://api.github.com/repos/phpspec/phpspec/issues/754/comments","events_url":"https://api.github.com/repos/phpspec/phpspec/issues/754/events","html_url":"https://github.com/phpspec/phpspec/issues/754","id":98773203,"number":754,"title":"Propose interface generation even without `use` or FQN","user":{"login":"sroze","id":804625,"avatar_url":"https://avatars.githubusercontent.com/u/804625?v=3","gravatar_id":"","url":"https://api.github.com/users/sroze","html_url":"https://github.com/sroze","followers_url":"https://api.github.com/users/sroze/followers","following_url":"https://api.github.com/users/sroze/following{/other_user}","gists_url":"https://api.github.com/users/sroze/gists{/gist_id}","starred_url":"https://api.github.com/users/sroze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sroze/subscriptions","organizations_url":"https://api.github.com/users/sroze/orgs","repos_url":"https://api.github.com/users/sroze/repos","events_url":"https://api.github.com/users/sroze/events{/privacy}","received_events_url":"https://api.github.com/users/sroze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-03T15:50:05Z","updated_at":"2015-08-03T16:20:08Z","closed_at":null,"body":"Right now, in order to have interfaces generated by PhpSpec, we need to manually add a `use` statement or to typehint a FQN.\r\n\r\nIMO, I'd be nice to propose the generation of that interface instead of throwing the \"collaborator does not exist\" error.\r\n\r\nFor instance, with the given spec:\r\n```php\r\nnamespace spec\\Foo\\Bar;\r\n\r\nclass BazSpec extends ObjectBehavior\r\n{\r\n    function let(AnotherOne $anotherOne)\r\n    {\r\n        $this->beConstructedWith($anotherOne);\r\n    }\r\n}\r\n```\r\n\r\nIt'll propose to generate the `Foo\\Bar\\AnotherOne` interface. If the typehinting is `Baz\\AnotherOne`, it'd create the `Foo\\Bar\\Baz\\AnotherOne` interface.\r\n\r\nI'm starting to dig into that :smiley: "},"comment":{"url":"https://api.github.com/repos/phpspec/phpspec/issues/comments/127298452","html_url":"https://github.com/phpspec/phpspec/issues/754#issuecomment-127298452","issue_url":"https://api.github.com/repos/phpspec/phpspec/issues/754","id":127298452,"user":{"login":"ciaranmcnulty","id":237866,"avatar_url":"https://avatars.githubusercontent.com/u/237866?v=3","gravatar_id":"","url":"https://api.github.com/users/ciaranmcnulty","html_url":"https://github.com/ciaranmcnulty","followers_url":"https://api.github.com/users/ciaranmcnulty/followers","following_url":"https://api.github.com/users/ciaranmcnulty/following{/other_user}","gists_url":"https://api.github.com/users/ciaranmcnulty/gists{/gist_id}","starred_url":"https://api.github.com/users/ciaranmcnulty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciaranmcnulty/subscriptions","organizations_url":"https://api.github.com/users/ciaranmcnulty/orgs","repos_url":"https://api.github.com/users/ciaranmcnulty/repos","events_url":"https://api.github.com/users/ciaranmcnulty/events{/privacy}","received_events_url":"https://api.github.com/users/ciaranmcnulty/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T16:20:08Z","updated_at":"2015-08-03T16:20:08Z","body":"@sroze No I agree with your example, I guess 2 should be 'same level as the spec'"}}