original_string: public function juggle($value, $type)
      {
          // Cast non-null values
          if ( ! is_null($value)) {
              // Ensure that the type is a valid type to cast.
              // We do this check here because it might not have been done
              // as is the case when the model is first initialized.
              if ($this->checkJuggleType($type)) {
                  // Get the method that the type maps to
                  $method = $this->buildJuggleMethod($type);
  
                  // Cast the value to the type using the method
                  $value = $this->{$method}($value);
              }
          }
  
          return $value;
      }
code: public function juggle($value, $type)
      {
          // Cast non-null values
          if ( ! is_null($value)) {
              // Ensure that the type is a valid type to cast.
              // We do this check here because it might not have been done
              // as is the case when the model is first initialized.
              if ($this->checkJuggleType($type)) {
                  // Get the method that the type maps to
                  $method = $this->buildJuggleMethod($type);
  
                  // Cast the value to the type using the method
                  $value = $this->{$method}($value);
              }
          }
  
          return $value;
      }
code_tokens: public function juggle ( $ value , $ type ) { // Cast non-null values if ( ! is_null ( $ value ) ) { // Ensure that the type is a valid type to cast. // We do this check here because it might not have been done // as is the case when the model is first initialized. if ( $ this -> checkJuggleType ( $ type ) ) { // Get the method that the type maps to $ method = $ this -> buildJuggleMethod ( $ type ) ; // Cast the value to the type using the method $ value = $ this -> { $ method } ( $ value ) ; } } return $ value ; }
docstring: Cast the value to the attribute's type as specified in the juggable array.
  
  @param mixed  $value
  @param string $type
  
  @throws InvalidArgumentException
  
  @return mixed
docstring_tokens: Cast the value to the attribute s type as specified in the juggable array .