{"action":"opened","issue":{"url":"https://api.github.com/repos/michaeldouglas/laravel-pagseguro/issues/28","labels_url":"https://api.github.com/repos/michaeldouglas/laravel-pagseguro/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/michaeldouglas/laravel-pagseguro/issues/28/comments","events_url":"https://api.github.com/repos/michaeldouglas/laravel-pagseguro/issues/28/events","html_url":"https://github.com/michaeldouglas/laravel-pagseguro/issues/28","id":111398541,"number":28,"title":"Padronizar manipulação de items do Payment","user":{"login":"hagnat","id":344834,"avatar_url":"https://avatars.githubusercontent.com/u/344834?v=3","gravatar_id":"","url":"https://api.github.com/users/hagnat","html_url":"https://github.com/hagnat","followers_url":"https://api.github.com/users/hagnat/followers","following_url":"https://api.github.com/users/hagnat/following{/other_user}","gists_url":"https://api.github.com/users/hagnat/gists{/gist_id}","starred_url":"https://api.github.com/users/hagnat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hagnat/subscriptions","organizations_url":"https://api.github.com/users/hagnat/orgs","repos_url":"https://api.github.com/users/hagnat/repos","events_url":"https://api.github.com/users/hagnat/events{/privacy}","received_events_url":"https://api.github.com/users/hagnat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-14T13:30:07Z","updated_at":"2015-10-14T13:30:07Z","closed_at":null,"body":"## situação atual\r\na classe ```\\laravel\\pagseguro\\Payment\\Payment``` possui tres metodos para manipulação de items\r\n-  addItem\r\n- getItems\r\n- setItemCollection\r\n\r\n## desejado\r\n- renomear a função ```setItemCollection``` para ```setItems```\r\n  - permitir que a função receba tanto um ```ItemInterface[]``` quanto um ```ItemCollection```\r\n- a função ```getItems()``` retorna uma ```ItemCollection``` previamente determinada\r\n  - se nenhuma ```ItemCollection``` foi determinada previamente, faz lazy loading\r\n- remover a função ```addItem```\r\n  - não é responsabilidade da classe ```Payment``` adicionar ```Item```, mas sim do ```ItemCollection``` retornado pelo ```getItems()```\r\n  - é possivel manter a função ```addItem(ItemInterface $item)```, mas marcar ela como deprecated e fazer dela um simples atalho para ```$this->getItems()->add($item);```\r\n\r\n"}}