original_string: private function fetchValueForKey($key, $value)
      {
          if (in_array($key, $this->getDates())) {
              return trim($value) === '' ? null : $value;
          }
  
          if (! $this->hasSetMutator($key)) {
              $value = $this->getAttribute($key);
          }
  
          if ($this->isJsonCastable($key) && ! is_null($value)) {
              $value = is_string($value) ? $this->getJsonCastValue($value) : $value;
          }
  
          return $value;
      }
code: private function fetchValueForKey($key, $value)
      {
          if (in_array($key, $this->getDates())) {
              return trim($value) === '' ? null : $value;
          }
  
          if (! $this->hasSetMutator($key)) {
              $value = $this->getAttribute($key);
          }
  
          if ($this->isJsonCastable($key) && ! is_null($value)) {
              $value = is_string($value) ? $this->getJsonCastValue($value) : $value;
          }
  
          return $value;
      }
code_tokens: private function fetchValueForKey ( $ key , $ value ) { if ( in_array ( $ key , $ this -> getDates ( ) ) ) { return trim ( $ value ) === '' ? null : $ value ; } if ( ! $ this -> hasSetMutator ( $ key ) ) { $ value = $ this -> getAttribute ( $ key ) ; } if ( $ this -> isJsonCastable ( $ key ) && ! is_null ( $ value ) ) { $ value = is_string ( $ value ) ? $ this -> getJsonCastValue ( $ value ) : $ value ; } return $ value ; }
docstring: For the given key and value pair, determine the actual value,
  depending on whether or not a mutator or cast is in use.
  
  @param  string  $key
  @param  mixed  $value
  
  @return mixed
docstring_tokens: For the given key and value pair determine the actual value depending on whether or not a mutator or cast is in use .