original_string: public static function log(LoggerInterface $logger = null, $message, $context = [])
      {
          if ($logger) {
              $logger->warning($message, $context);
          } else {
              $replace = [];
              foreach ($context as $k => $v) {
                  if (is_scalar($v)) {
                      $replace['{'.$k.'}'] = $v;
                  }
              }
              @trigger_error(strtr($message, $replace), E_USER_WARNING);
          }
      }
code: public static function log(LoggerInterface $logger = null, $message, $context = [])
      {
          if ($logger) {
              $logger->warning($message, $context);
          } else {
              $replace = [];
              foreach ($context as $k => $v) {
                  if (is_scalar($v)) {
                      $replace['{'.$k.'}'] = $v;
                  }
              }
              @trigger_error(strtr($message, $replace), E_USER_WARNING);
          }
      }
code_tokens: public static function log ( LoggerInterface $ logger = null , $ message , $ context = [ ] ) { if ( $ logger ) { $ logger -> warning ( $ message , $ context ) ; } else { $ replace = [ ] ; foreach ( $ context as $ k => $ v ) { if ( is_scalar ( $ v ) ) { $ replace [ '{' . $ k . '}' ] = $ v ; } } @ trigger_error ( strtr ( $ message , $ replace ) , E_USER_WARNING ) ; } }
docstring: Internal logging helper.
  
  @internal
docstring_tokens: Internal logging helper .