original_string: public function getPayload(string $key, $default = null)
      {
          if ($this->payload === null) {
              $contentType = $this->getHeader('Content-Type', '');
              if (!$contentType) {
                  $contentType = $this->getHeader('Content-type');
              }
  
              if ($contentType) {
                  $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType);
                  $contentType = $contentTypeParts[0];
                  $contentType = strtolower($contentType);
                  if (isset($this->bodyParsers[$contentType])) {
                      $parser = $this->bodyParsers[$contentType];
                      $this->payload = $parser($this->body);
                  }
              }
          }
  
          return $this->payload[$key] ?? $default;
      }
code: public function getPayload(string $key, $default = null)
      {
          if ($this->payload === null) {
              $contentType = $this->getHeader('Content-Type', '');
              if (!$contentType) {
                  $contentType = $this->getHeader('Content-type');
              }
  
              if ($contentType) {
                  $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType);
                  $contentType = $contentTypeParts[0];
                  $contentType = strtolower($contentType);
                  if (isset($this->bodyParsers[$contentType])) {
                      $parser = $this->bodyParsers[$contentType];
                      $this->payload = $parser($this->body);
                  }
              }
          }
  
          return $this->payload[$key] ?? $default;
      }
code_tokens: public function getPayload ( string $ key , $ default = null ) { if ( $ this -> payload === null ) { $ contentType = $ this -> getHeader ( 'Content-Type' , '' ) ; if ( ! $ contentType ) { $ contentType = $ this -> getHeader ( 'Content-type' ) ; } if ( $ contentType ) { $ contentTypeParts = preg_split ( '/\s*[;,]\s*/' , $ contentType ) ; $ contentType = $ contentTypeParts [ 0 ] ; $ contentType = strtolower ( $ contentType ) ; if ( isset ( $ this -> bodyParsers [ $ contentType ] ) ) { $ parser = $ this -> bodyParsers [ $ contentType ] ; $ this -> payload = $ parser ( $ this -> body ) ; } } } return $ this -> payload [ $ key ] ?? $ default ; }
docstring: get body param
  
  @param $key string
  @param null $default mixed
  @return mixed|null
docstring_tokens: get body param