nepda / youtrack-client

A PHP client library for the popular YouTrack bugtracker from jetBrains.
BSD 3-Clause "New" or "Revised" License
25 stars 32 forks source link

Add class-level docblock declaration with a couple of available fields accessible for a Jira issue #26

Closed technodelight closed 8 years ago

technodelight commented 8 years ago

This list is not full, but your IDE will still benefit from it. It will also help you phpspec-ing when using this class.

nepda commented 8 years ago

Thank you for this request! :) I think merging this is not a easy decision. E.g. in my use cases, no JIRA is ever used. Hence the getJiraId method does not return anything and the method-docs will mislead developers. In addition to this, you don't provide return types for the methods. Do you have any other pro-arguments on this?

technodelight commented 8 years ago

Hi @nepda ! Well, hahah, sorry about that. It looks like I somehow left rubbish methods which doesn't even required nor makes sense. I declared the return values as mixed, however it would be string|null in most cases. Let me fix that and let's continue the discussion.

technodelight commented 8 years ago

Hi there - I've added the field doc blocks as per current documentation. I guess this looks a lot better now. Regarding not-so-commonly used fields: as this is a general library for the YouTrack REST API, I think adding the method declarations (with an explanation for each field) will definitely avoid confusion. Also, without this change it's impossible to mock the Issue object in a phpspec test. This is due to a limitation in phpspec/prophecy, which only allows you to use magic methods when they are defined as @method declarations. There were some fields which I wasn't able to check properly, like the permittedUserGroup or the tag. I would appreciate any further advise on this :) I hope this explanation convinces you somewhat better :) Cheers

nepda commented 8 years ago

I've discovered tags don't work at all currently :( Yes, this looks much better. I'll just merge this and wait for further feedback of the community.

technodelight commented 8 years ago

Nice one, thanks! Happy to resolve if something comes up.

nepda commented 8 years ago

You're welcome, thank you too! :)