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

Methods for StreamWrapper are declared in error #1003

Closed
Progi1984 opened this issue May 14, 2016 · 5 comments
Closed

Methods for StreamWrapper are declared in error #1003

Progi1984 opened this issue May 14, 2016 · 5 comments

Comments

@Progi1984
Copy link

Hi I use PHP_CS for PHPOffice\PHPExcel, we have some classes that we use with streams.

But for PHPCS, methods for these classes are in error but it's the implementation for StreamWrapper.

  67 | ERROR | Method name "ChainedBlockStream::stream_open" is not in camel caps format
 121 | ERROR | Method name "ChainedBlockStream::stream_close" is not in camel caps format
 133 | ERROR | Method name "ChainedBlockStream::stream_read" is not in camel caps format
 148 | ERROR | Method name "ChainedBlockStream::stream_eof" is not in camel caps format
 159 | ERROR | Method name "ChainedBlockStream::stream_tell" is not in camel caps format
 171 | ERROR | Method name "ChainedBlockStream::stream_seek" is not in camel caps format
 190 | ERROR | Method name "ChainedBlockStream::stream_stat" is not in camel caps format

Travis CI Errors : https://travis-ci.org/PHPOffice/PHPExcel/jobs/130181980#L325
Code : https://github.com/PHPOffice/PHPExcel/blob/1.9/src/PhpSpreadsheet/Shared/OLE/ChainedBlockStream.php
Doc PHP : http://php.net/manual/en/class.streamwrapper.php

Poke @MarkBaker

@aik099
Copy link
Contributor

aik099 commented May 14, 2016

What are you proposing?

@Progi1984
Copy link
Author

The idea would be the test of the name of the method and if it is in the list of the methods from StreamWrapper, that doesn't trigger any error.

@aik099
Copy link
Contributor

aik099 commented May 17, 2016

There can be another class in the system having these methods and not in any relation with StreamWrapper.

When using vendor code that doesn't comply with standard of the project there is no much we can do about it.

@Progi1984
Copy link
Author

Yeah, you're right : StreamWrapper classes can't be detected as instance of StreamWrapper.

So the solution would be ignoreLine and specific rules... #604

@gsherwood
Copy link
Member

Closing this as I can't see a way of ignoring these method names without hard-coding them (and a lot of others). Excluding specific rules for files can already be done in a ruleset.xml file, so I'd recommend that. Being able to do it with code comments is a useful feature, and linked in the comment above.

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

3 participants