Issue Feature Closed

#45022Utility function to deprecate public method calls.

Sebastian Michaelsen 01/31/13, 13:50 updated 01/06/15, 20:30

Description

At the moment we have a lot of public methods which are not intended for being public. We need a way to deprecate calling them publicly, therefore a Utility Function is introduced.

Usage:

    /**
     * @publicCallDeprecated Since 6.1. Will be protected 2 versions later
     */
    public function privateFoo() {
        GeneralUtility::logDeprecatedPublicMethodCall();
        // do stuff
    }

If the method is called publicy an entry like this is being made to the deprecation log:

Deprecated public method call: MyClass->privateFoo() was called publicly which is deprecated (Since 6.1. Will be protected 2 versions later). [DEBUG TRAIL]

I’m not sure if it is ok to just invent a new phpDoc annotation. But it’s the best solution I found to store information about the deprecation strategy.

Reviews 1