Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read string as well as a file #5

Open
jbrooksuk opened this issue Aug 19, 2014 · 4 comments
Open

Read string as well as a file #5

jbrooksuk opened this issue Aug 19, 2014 · 4 comments

Comments

@jbrooksuk
Copy link
Contributor

Currently PHPCheckstyle is only able to check the style guides against files and not a string itself.

Rather than messing with processFiles, I'm thinking of adding just process as a method itself. This gives the end-developer much more flexibility.

@tchule
Copy link
Contributor

tchule commented Aug 22, 2014

I like the idea, to be able to process any given string would be cool.

We will need to cleanup a few things I think. The "processFiles" method set up some variables and flags (current file name, ...). We can check if we have consistent defaut values for these flags, and when possible eliminate or move all these variables.

@jbrooksuk
Copy link
Contributor Author

When I was looking at doing this, I realised that processFiles does too much in one method:

  • Setup error handlers
  • Grab the sources
  • Begin counting lines
  • Process each file
  • Clean up

We could split out some methods so that they can be re-used by a process method.

@tchule
Copy link
Contributor

tchule commented Aug 22, 2014

Agree, there is some cleanup to do.

@jbrooksuk
Copy link
Contributor Author

I started looking at this, but quickly realised that there are a lot of changes required.

  • Tokenizer@tokenize takes a file name for example.
  • PHPCheckstyle@processFiles calls _processFile which assume it's a file.

This requires a big rewrite of the core methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants