phpsa icon indicating copy to clipboard operation
phpsa copied to clipboard

Start to work on generic issue reporters

Open K-Phoen opened this issue 7 years ago • 3 comments

Hey!

Type: new feature

Link to issue:

This pull request affects the following components (please check boxes):

  • [x] Core
  • [ ] Analyzer
  • [ ] Compiler
  • [ ] Control Flow Graph
  • [ ] Documentation

In raising this pull request, I confirm the following (please check boxes):

  • [x] I have read and understood the Contributing Guidelines.
  • [x] I have checked that another pull request for this purpose does not exist.
  • [x] I wrote some tests for this PR.

Small description of change:

This PR starts to make the output generation generic. We should be able to generate several output formats depending on what the user wants (xml, json, text, …). For now, I only introduced a generic way to transform issues to JSON/XML, other. In future commits, I'll work on a solution to combine several outputs, manage IO, etc.

Thanks

K-Phoen avatar Oct 11 '16 10:10 K-Phoen

I assigned you to issue #18 then. It's HTML output. For start it would be enough to just wrap it in some html tags, the styling can be done later

ddmler avatar Oct 11 '16 10:10 ddmler

@ovr, @ddmler I reworked the initial commit a bit.

This PR now introduces the notion of reporter (a class in charge of reporting issues to the user), that can use different formatters and outputs.

In order to make it work, I also had to clean a few things, hence the number of modified lines.

K-Phoen avatar Oct 11 '16 21:10 K-Phoen

@ovr If that sounds good to you, I think that I will modify the codeclimate-related code to be just another output format. I'll create an issue for that and do it in a separate PR.

Also, I think that the Context class looks to much like a god object (it holds too much responsibilities) and that we should think about what we want to do about it. If we actually want to do something about it.

WDYT?

K-Phoen avatar Oct 13 '16 07:10 K-Phoen