HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30
System: Linux multiplicar 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64
User: root (0)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /var/www/html/maxicambios.sumar.com.py/lib/phpxmlrpc/Traits/DeprecationLogger.php
<?php

namespace PhpXmlRpc\Traits;

use PhpXmlRpc\PhpXmlRpc;

trait DeprecationLogger
{
    use LoggerAware;

    protected function logDeprecation($message)
    {
        if (PhpXmlRpc::$xmlrpc_silence_deprecations) {
            return;
        }

        $this->getLogger()->warning('XML-RPC Deprecated: ' . $message);
    }

    /**
     * @param string $callee
     * @param string $expectedCaller atm only the method name is supported
     * @return void
     */
    protected function logDeprecationUnlessCalledBy($expectedCaller)
    {
        if (PhpXmlRpc::$xmlrpc_silence_deprecations) {
            return;
        }

        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
        /// @todo we should check as well $trace[2]['class'], and make sure that it is a descendent of the class passed in in $expectedCaller
        if ($trace[2]['function'] === $expectedCaller) {
            return;
        }

        $this->getLogger()->warning('XML-RPC Deprecated: ' . $trace[1]['class'] . '::' . $trace[1]['function'] .
            ' is only supposed to be called by ' . $expectedCaller);
    }
}