original_string: protected function _interpolate($query)
      {
          $params = array_map(function ($p) {
              if ($p === null) {
                  return 'NULL';
              }
              if (is_bool($p)) {
                  return $p ? '1' : '0';
              }
  
              if (is_string($p)) {
                  $replacements = [
                      '$' => '\\$',
                      '\\' => '\\\\\\\\',
                      "'" => "''",
                  ];
  
                  $p = strtr($p, $replacements);
  
                  return "'$p'";
              }
  
              return $p;
          }, $query->params);
  
          $keys = [];
          $limit = is_int(key($params)) ? 1 : -1;
          foreach ($params as $key => $param) {
              $keys[] = is_string($key) ? "/:$key\b/" : '/[?]/';
          }
  
          return preg_replace($keys, $params, $query->query, $limit);
      }
code: protected function _interpolate($query)
      {
          $params = array_map(function ($p) {
              if ($p === null) {
                  return 'NULL';
              }
              if (is_bool($p)) {
                  return $p ? '1' : '0';
              }
  
              if (is_string($p)) {
                  $replacements = [
                      '$' => '\\$',
                      '\\' => '\\\\\\\\',
                      "'" => "''",
                  ];
  
                  $p = strtr($p, $replacements);
  
                  return "'$p'";
              }
  
              return $p;
          }, $query->params);
  
          $keys = [];
          $limit = is_int(key($params)) ? 1 : -1;
          foreach ($params as $key => $param) {
              $keys[] = is_string($key) ? "/:$key\b/" : '/[?]/';
          }
  
          return preg_replace($keys, $params, $query->query, $limit);
      }
code_tokens: protected function _interpolate ( $ query ) { $ params = array_map ( function ( $ p ) { if ( $ p === null ) { return 'NULL' ; } if ( is_bool ( $ p ) ) { return $ p ? '1' : '0' ; } if ( is_string ( $ p ) ) { $ replacements = [ '$' => '\\$' , '\\' => '\\\\\\\\' , "'" => "''" , ] ; $ p = strtr ( $ p , $ replacements ) ; return "'$p'" ; } return $ p ; } , $ query -> params ) ; $ keys = [ ] ; $ limit = is_int ( key ( $ params ) ) ? 1 : - 1 ; foreach ( $ params as $ key => $ param ) { $ keys [ ] = is_string ( $ key ) ? "/:$key\b/" : '/[?]/' ; } return preg_replace ( $ keys , $ params , $ query -> query , $ limit ) ; }
docstring: Helper function used to replace query placeholders by the real
  params used to execute the query
  
  @param \Cake\Database\Log\LoggedQuery $query The query to log
  @return string
docstring_tokens: Helper function used to replace query placeholders by the real params used to execute the query