Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Deprecate protected underscore methods and vars #501

Closed
wants to merge 1 commit into from
Closed

Deprecate protected underscore methods and vars #501

wants to merge 1 commit into from

Conversation

elkuku
Copy link
Contributor

@elkuku elkuku commented Nov 9, 2011

This is a proposal on how to deal with the remaining code style complaints about protected methods and class variables beginning with an underscore, by creating proxies and enclosing the deprecated functions in @codingStandardsIgnoreStart and -End tags.
A much better solution would be, of course, if the methods could just be renamed.

If this makes any sense you might leave this open for a while and I (or others) might fix the remaing 438 warnings ;)

* @since 11.1
* @deprecated X - use makeItem()
*/
protected function _makeItem($name, $link)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should log that a deprecated method was called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, haven’t thought about it.. So that would be 441 log entries more...

@joomla-jenkins
Copy link

The tests completed but there was a problem parsing the report.
Unit testing complete. There were 0 failures and 0 errors from 1685 tests and 10563 assertions.
Checkstyle analysis reported 438 warnings and 0 errors.

@chdemko
Copy link
Contributor

chdemko commented Nov 9, 2011

I've proposed another solution for this fix: ignore var/function beginning with _ if they are marked deprecated

See #501

@LouisLandry
Copy link
Contributor

We could always just change protected $_foo to protected $foo and create a public function __get() / __set() that handles the deprecated usage.

@chdemko
Copy link
Contributor

chdemko commented Nov 9, 2011

@louis, it will work for instance vars but PHP does not have (yet) __getStatic and __setStatic method to handle class vars

@elkuku
Copy link
Contributor Author

elkuku commented Nov 9, 2011

Christophe, I think you meant #502 ;) very clever 👍

I am going to close this one in favor of your solution.

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

Successfully merging this pull request may close these issues.

None yet

7 participants