ZF-1308: Coding standards compliance, including private method names

Description

The private {{Zend_Service_Audioscrobbler::getInfo()}} method does not follow coding standards for private and protected method names:

Though function names may not contain the underscore character, class methods that are declared as protected or private must begin with a single underscore, as in the following example:


class Zend_Foo 
{ 
    protected function _fooBar() 
    { 
        // ... 
    } 
}

Other members of this component, such as {{$testing}} and {{$testing_response}} also should be modified to comply with coding standards.

I should also recommend considering whether {{private}} is the appropriate designation for such class members. Though sometimes appropriate to use {{private}}, it is generally the case that making class members {{protected}} allows for an appropriate public API while providing for extensibility through class inheritance.

Comments

I contacted Chris, I'm going to take in charge this fix. :)

@ Darby

Considering that those methods/variables were declared as protected, I assume it's safe to change their scope/name for the next ZF release (1.5). There shouldn't be any BC issue.

Do you agree?

Well, I do not agree that there is no BC issue. Obviously people who have extended the class could be affected. However, because the likelihood of such extension for this component seems minimal, and because the BC impact deals only with naming (e.g., not behavioral changes to class logic), I do not see insurmountable problems arising with making the changes for 1.5. Thanks for looking at this, Simone! :)

Obviously people who have extended the class could be affected.

Perhaps I confused PHP behavior with Java... but as far I remember (in PHP) child classes haven't access to parent private methods but only to protected or public ones. But may be I'm wrong, I'm going to run more tests.

I do not see insurmountable problems arising with making the changes for 1.5.

Great, I'm going to fix this ticket asap.

bq. Perhaps I confused PHP behavior with Java... but as far I remember (in PHP) child classes haven't access to parent private methods but only to protected or public ones. But may be I'm wrong, I'm going to run more tests.

Yes, of course, I meant that renaming protected methods could affect extending classes.

Thanks again! :)

fixed in r7364

Merged to branch/release-1.0 (r7688), target changed to mini release.