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

How to do overrides #57

Closed
wilcorrea opened this issue Apr 7, 2017 · 10 comments
Closed

How to do overrides #57

wilcorrea opened this issue Apr 7, 2017 · 10 comments

Comments

@wilcorrea
Copy link

wilcorrea commented Apr 7, 2017

Hello guys,
I'm using phpcs-calisthenics-rules with the PhpStorm inspector and when I do property overrides like this below I get an error like the second image with that content: https://gist.github.com/wilcorrea/93d37027c5fac6f7a74a566dab02bf93

If I change the visibility of property into the sniff class the "error disappeared"... but I believe it should be another way to override without receiving messages.


My override
image

Version installed on composer.lock (https://gist.github.com/wilcorrea/93d37027c5fac6f7a74a566dab02bf93)
image

Message of PhpStorm
image

SO and PHP version

PHP 7.0.17-2+deb.sury.org~trusty+1 (cli) (built: Mar 15 2017 09:38:47) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.17-2+deb.sury.org~trusty+1, Copyright (c) 1999-2017, by Zend Technologies
@TomasVotruba
Copy link
Contributor

Hey, thanks for awesome issue report. I got all I could ever think off! 👏

2.0 is quite old now. Could you try this with with last RC version https://github.com/object-calisthenics/phpcs-calisthenics-rules/tree/v3.0.0-RC1 please? Thank you.

@wilcorrea
Copy link
Author

Ok, I will try it ; )
Thanks for the feeback o./

@wilcorrea
Copy link
Author

Welll, I get the instalation with composer require "object-calisthenics/phpcs-calisthenics-rules:3.0.0-RC1" "squizlabs/php_codesniffer:3.0.0RC4" --dev after upgrade PHP to 7.1.

Now things are making a little more sense because the documentation was not according to what I was using and was getting a little lost. Thanks for the clarifications. Congratulations to everyone involved in the project!

@TomasVotruba
Copy link
Contributor

Now things are making a little more sense because the documentation was not according to what I was using and was getting a little lost.

I'm aware of that. That usually happens, because the code here is master, but not last stable.

I sometimes send duplicated PRs and issues for what is already solved due to this :D


I'm curious... it looks like you really find these rules useful. I'd appreciate any feedback on how do you use them, where you struggle (even a little) or what could be improved.

I want this project to be as clear as possible to everyone who sees it first time and I'd appreciate your help with that.

@wilcorrea
Copy link
Author

Yep, I'm using into PhpStorm like a linter and it is helpful. I already use phpMD and phpCS(PSR-2) and was looking for an option to inspect Calisthenics approach. I still don't have points about the tool, but appreciate a lot that kind of work.

After restart the tests, I started with other problems. Apparently phpcs is not loading the interface of Sniffs, I believe what is because I'm using the .phar and not the files downloaded by composer. I will try get a early version of phpcs.


That is the message of error
https://gist.github.com/wilcorrea/4b25c21073a3f26ef966fa28af94aa68 (message raw)

image

That is my ruleset.xml

https://gist.github.com/wilcorrea/b63eab5df9c8a0b1e52b221327f0755f

@wilcorrea
Copy link
Author

The earlier download of phpcs.phar apparently is

$ php phpcs.phar --version
PHP_CodeSniffer version 2.8.1 (stable) by Squiz (http://www.squiz.net)

@wilcorrea
Copy link
Author

I changed the settings of PhpStorm to use the bin what came with the phpcs in require-dev and now it is working ; )

I believe I can make a PR with my experience of configure the environment to contribute with the project as soon as I can ; )

@TomasVotruba
Copy link
Contributor

Yep, using phar is quite deprecated approach that is not compatible with this.

What did you end up with? PR with how-to for other would be awesome 👍

@TomasVotruba
Copy link
Contributor

Closing. Let me know if these is still some issue.

@wilcorrea
Copy link
Author

Thanks @TomasVotruba, nope, no problems! Working pretty ; )
I will send a PR with a how-to soon, sorry the delay, but the time is not helping

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

2 participants