original_string: public function nullIfEmpty($value, $key = null)
      {
          if (! is_null($key)) {
              $value = $this->fetchValueForKey($key, $value);
          }
  
          if (is_array($value)) {
              return $this->nullIfEmptyArray($key, $value);
          }
  
          if (is_bool($value)) {
              return $value;
          }
  
          return trim($value) === '' ? null : $value;
      }
code: public function nullIfEmpty($value, $key = null)
      {
          if (! is_null($key)) {
              $value = $this->fetchValueForKey($key, $value);
          }
  
          if (is_array($value)) {
              return $this->nullIfEmptyArray($key, $value);
          }
  
          if (is_bool($value)) {
              return $value;
          }
  
          return trim($value) === '' ? null : $value;
      }
code_tokens: public function nullIfEmpty ( $ value , $ key = null ) { if ( ! is_null ( $ key ) ) { $ value = $ this -> fetchValueForKey ( $ key , $ value ) ; } if ( is_array ( $ value ) ) { return $ this -> nullIfEmptyArray ( $ key , $ value ) ; } if ( is_bool ( $ value ) ) { return $ value ; } return trim ( $ value ) === '' ? null : $ value ; }
docstring: If value is empty, return null, otherwise return the original input.
  
  @param  string $value
  @param  null $key
  
  @return null|string
docstring_tokens: If value is empty return null otherwise return the original input .