Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Fix for odd php-cs-fixer finds #6462

Closed
wants to merge 1 commit into from
Closed

Fix for odd php-cs-fixer finds #6462

wants to merge 1 commit into from

Conversation

chadicus
Copy link
Contributor

I do not know why php-cs-fixer reported these errors, I'm assuming some character(s) within the files themselves caused some weird tokenizing.

On a fresh clone of zend/master You will get the following errors

zf2$ ./vendor/bin/php-cs-fixer fix -v --dry-run
Loaded config from "/home/chadicus/projects/zf2/.php_cs"
   1) Zend/Cache/Storage/Adapter/MemcachedResourceManager.php (visibility)
   2) Zend/Cache/Storage/Adapter/RedisResourceManager.php (visibility)
   3) Zend/Json/Decoder.php (visibility)
   4) Zend/Di/Di.php (visibility)
   5) ZendTest/Tag/Cloud/Decorator/HtmlTagTest.php (indentation)

My solution for all of the visibility errors was to move the methods within the class files. php-cs-fixer solution was to type-hint the methods with public resulting in

protected function getClass(public $instance)
{

@localheinz
Copy link
Member

@chadicus

For me the dry run fails with this only:

screen shot 2014-07-16 at 16 57 32

@DASPRiD
Copy link
Member

DASPRiD commented Jul 16, 2014

I don't think you should fix errors which aren't any. Make an issue report against PHP-CS-Fixer, but eventually, we switch to PHPCS anyway I suppose.

@chadicus
Copy link
Contributor Author

I was doing this so developers' builds would stop failing. The noise that these failures generates distracts from actual failures within a pull request.

@DASPRiD
Copy link
Member

DASPRiD commented Jul 16, 2014

Well, then the correct approach is to get rid of the buggy php-cs-fixer ;)

@chadicus
Copy link
Contributor Author

Started down that route after I saw @localheinz PR #6182. I added my own PR #6454

@chadicus
Copy link
Contributor Author

Feel free to close this PR if you would rather wait until php-cs-fixer is gone

@Ocramius Ocramius self-assigned this Jul 27, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone Jul 27, 2014
Ocramius added a commit that referenced this pull request Jul 27, 2014
@Ocramius Ocramius closed this in 389e288 Jul 27, 2014
@Ocramius
Copy link
Member

@chadicus merged, thanks!

@DASPRiD green is king, let's try to get there ;-)

@chadicus chadicus deleted the odd-phpcs-errors branch July 28, 2014 12:33
gianarb pushed a commit to zendframework/zend-tag that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-tag that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-di that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-di that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-json that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-json that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-cache that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants