SomeOtherService example

use acme\lib\SomeService;
use foo\lib\SomeOtherService;

final class AppService
{
    public function directDeprecationsTwoVendors()
    {
        $service1 = new SomeService();
        $service1->deprecatedApi();

        $service2 = new SomeOtherService();
        $service2->deprecatedApi();
    }

    public function selfDeprecation(bool $useContracts = false)
    {
        $args = [__FUNCTION__, __FUNCTION__];
        if ($useContracts) {
            trigger_deprecation('App', '3.0', sprintf('%s is deprecated, use %s_new instead.', ...$args));
        } else {
            @trigger_error(sprintf('Since App 3.0: %s is deprecated, use %s_new instead.', ...$args), \E_USER_DEPRECATED);
        }
    }
Home | Imprint | This part of the site doesn't use cookies.