Re: CS question: do private function namechanges count as API changes?

From: Date: Fri, 16 Nov 2007 19:43:43 +0000
Subject: Re: CS question: do private function namechanges count as API changes?
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-48476@lists.php.net to get a copy of this message
Hi, Jorrit Schippers wrote:
I'm currently working on Net_FTP, mainly to fix some bugs. But as I would like to get used to the PEAR codestyle, I started making the file PEAR CS compliant. One of the remaining errors is that some methods are not in camelcase (such as _determine_os_match). All of those methods are declared private in the php docs, as Net_FTP is PHP 4 compliant. I've read that API changes are not recommended, but do private method changes count as API methods? And should I change it to determineOSMatch(), _determineOSMatch() or perhaps (_)determineOsMatch()?
No, changes to private methods do not count as API breaks. Per coding standards you should prefix the private method's name with an underscore, so that's _determineOSMatch() (or _determineOsMatch(), the standards are a bit fuzzy on proper case to use here).
Besides that, what would be the correct way of keeping line 572 [1] within the required 85 character / line limit? It's a variable defined in the class, so tricks like splitting the string do not help.
You can use preg's 'x' modifier and add whitespace / linebreaks into the regexp, it will also allow comments inside it. And that abomination will benefit quite a bit from comments.

« previous php.pear.dev (#48476) next »