Last modified: 2012-10-11 19:15:10 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36808, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34808 - Change scope of private methods to protected
Change scope of private methods to protected
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
LdapAuthentication (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Ryan Lane
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-29 20:01 UTC by Noël
Modified: 2012-10-11 19:15 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Noël 2012-02-29 20:01:54 UTC
Hi,

we've written an Overlay for your LdapAuthentication Extension to fit our needs.
To achieve this, we wrote a class which is derived from LdapAuthenticationPlugin.

To avoid Code Duplication it would be great to make all the private functions protected so they can be accessed from a child class.

Especially the function getGroups. For your convenience i supplied a patch for this function.

Regards
No-L


===================================================================
--- LdapAuthentication.php	(Revision 110505)
+++ LdapAuthentication.php	(Arbeitskopie)
@@ -1425,7 +1425,7 @@
 	 * Function to get the user's groups.
 	 * @param string $username
 	 */
-	private function getGroups( $username ) {
+	protected function getGroups( $username ) {
 		$this->printDebug( "Entering getGroups", NONSENSITIVE );
Comment 1 Daniel Renfro 2012-09-26 12:36:50 UTC
Many methods in class LinksUpdate, CategoryViewer, and others are marked as private, when they should probably be protected. I don't see any reason why accessor methods need to be limited in their visibility. This breaks polymorphism and makes it hard (if not sometimes impossible) to write extensions.

 cd includes
 perl -pe 's/private/protected/g' -i LinksUpdate.php CategoryViewer.php
Comment 2 Ryan Lane 2012-09-26 19:47:43 UTC
Noël, would you mind pushing a change into gerrit for this?
Comment 3 Noël 2012-10-04 20:43:00 UTC
Gerrit change #26700

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links