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

InstantiateNewClassesSniff can be simplified #103

Open
aik099 opened this issue Apr 9, 2015 · 0 comments
Open

InstantiateNewClassesSniff can be simplified #103

aik099 opened this issue Apr 9, 2015 · 0 comments

Comments

@aik099
Copy link

aik099 commented Apr 9, 2015

The https://github.com/joomla/coding-standards/blob/master/Sniffs/Classes/InstantiateNewClassesSniff.php sniff is doing a lot of comparisons inside, but if it really checks that no () are present after new SomeClass then why it's not checking that.

  1. find class name, that is created (including namespace)
  2. get next non-whitespace char and if it's not ( then return
  3. get next non-whitespace char and if it's not ) then report an error and return in other case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant