original_string: public function extract($value)
      {
          if (is_string($value)) {
              return new MongoId($value);
          }
          
          if ($this->nullable && $value === null) {
              return null;
          }
          
          throw new Exception\InvalidArgumentException(sprintf(
              'Invalid value: must be a string containing a valid mongo ID, "%s" given.',
              is_object($value) ? get_class($value) : gettype($value)
          ));
      }
code: public function extract($value)
      {
          if (is_string($value)) {
              return new MongoId($value);
          }
          
          if ($this->nullable && $value === null) {
              return null;
          }
          
          throw new Exception\InvalidArgumentException(sprintf(
              'Invalid value: must be a string containing a valid mongo ID, "%s" given.',
              is_object($value) ? get_class($value) : gettype($value)
          ));
      }
code_tokens: public function extract ( $ value ) { if ( is_string ( $ value ) ) { return new MongoId ( $ value ) ; } if ( $ this -> nullable && $ value === null ) { return null ; } throw new Exception \ InvalidArgumentException ( sprintf ( 'Invalid value: must be a string containing a valid mongo ID, "%s" given.' , is_object ( $ value ) ? get_class ( $ value ) : gettype ( $ value ) ) ) ; }
docstring: Ensure the value extracted is typed as MongoId or null
  
  @param mixed $value The original value.
  @return null|MongoId Returns the value that should be extracted.
docstring_tokens: Ensure the value extracted is typed as MongoId or null