Skip to content

Commit

Permalink
docs: Updated misspelled and missing docblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
KamasamaK authored Mar 26, 2024
1 parent c96d16e commit 1ba168b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions models/CfhttpHttpClient.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ component implements="HyperHttpClientInterface" {
attrCollection[ "workstation" ] = req.getWorkStation();
}

// this is only necessarry for NTLM authType, BASIC is the default
// this is only necessary for NTLM authType, BASIC is the default
if ( len( req.getAuthType() ) && len( req.getUsername() ) ) {
attrCollection[ "authType" ] = req.getAuthType();
}
Expand Down Expand Up @@ -222,7 +222,7 @@ component implements="HyperHttpClientInterface" {
attrCollection[ "workstation" ] = req.getWorkStation();
}

// this is only necessarry for NTLM authType, BASIC is the default
// this is only necessary for NTLM authType, BASIC is the default
if ( len( req.getAuthType() ) && len( req.getUsername() ) ) {
attrCollection[ "authType" ] = req.getAuthType();
}
Expand Down
32 changes: 24 additions & 8 deletions models/HyperRequest.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ component accessors="true" {
property name="headers";

/**
* A struct of headers for the request.
* A struct of cookies for the request.
*/
property name="cookies";

/**
* A struct of query parameters for the request.
* An array of query parameters for the request.
*/
property name="queryParams";

Expand Down Expand Up @@ -194,6 +194,8 @@ component accessors="true" {
/**
* Initialize a new HyperRequest.
*
* @httpClient The HTTP client to use for the request. Must implement HyperHttpClientInterface.
*
* @returns The HyperRequest instance.
*/
function init( httpClient = new CfhttpHttpClient() ) {
Expand Down Expand Up @@ -598,7 +600,7 @@ component accessors="true" {
}

/**
* Gets the first value for a certian query parameter.
* Gets the first value for a certain query parameter.
* @deprecated Use `getQueryParamByName`
*
* @name The name of the query parameter to retrieve its value.
Expand All @@ -611,7 +613,7 @@ component accessors="true" {
}

/**
* Gets the first value for a certian query parameter.
* Gets the first value for a certain query parameter.
*
* @name The name of the query parameter to retrieve its value.
*
Expand All @@ -629,7 +631,7 @@ component accessors="true" {
}

/**
* Get all the values for a certian query parameter.
* Get all the values for a certain query parameter.
*
* @name The name of the query parameter to retrieve all of its values.
*
Expand Down Expand Up @@ -713,7 +715,7 @@ component accessors="true" {
/**
* Add additional cookies to the request.
*
* @headers A struct of cookies to add to the request.
* @cookies A struct of cookies to add to the request.
*
* @returns The HyperRequest instance.
*/
Expand Down Expand Up @@ -984,7 +986,7 @@ component accessors="true" {
/**
* A convenience method to set the User-Agent header.
*
* @type The User-Agent value for the request.
* @userAgent The User-Agent value for the request.
*
* @returns The HyperRequest instance.
*/
Expand Down Expand Up @@ -1034,6 +1036,8 @@ component accessors="true" {
* Returns the full url for the request.
* Combines the baseURL, the URL, and the serialized queryParams.
*
* @withQueryString Whether to include the query string in the full url.
*
* @returns The full url for the request.
*/
function getFullUrl( withQueryString = false ) {
Expand Down Expand Up @@ -1208,6 +1212,15 @@ component accessors="true" {
return this;
}

/**
* Configures the request's retry by setting the number of attempts, delays between attempts, and condition
*
* @attempts The maximum number of attempts to retry or an array of delays for each attempt.
* @delay The number of milliseconds to wait between retries.
* @predicate A predicate function to determine if the retry should be attempted.
*
* @returns The HyperRequest instance.
*/
public HyperRequest function retry(
required any attempts,
numeric delay,
Expand Down Expand Up @@ -1327,7 +1340,7 @@ component accessors="true" {
}

/**
* Send a new request based on the redirect response recieved.
* Send a new request based on the redirect response received.
*
* @res The HyperResponse specifying a redirect.
*
Expand Down Expand Up @@ -1508,6 +1521,9 @@ component accessors="true" {
return variables.pathPatternMatcher;
}

/**
* Gets the version of hyper being used and also stores it in the application scope.
*/
public string function getHyperVersion() {
if ( !structKeyExists( application, "hyperVersion" ) ) {
application.hyperVersion = deserializeJSON( fileRead( expandPath( "/hyper/box.json" ) ) ).version;
Expand Down
4 changes: 3 additions & 1 deletion models/HyperResponse.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ component accessors="true" {
* @executionTime The execution time of the request, in milliseconds.
* @charset The response charset. Default: UTF-8
* @statusCode The response status code. Default: 200.
* @statusText The response status text. Default: OK.
* @headers The response headers. Default: {}.
* @data The response data. Default: "".
* @timestamp The timestamp for when this response was received. Default: `now()`.
* @responseID Unique response ID representing this response. Default: `createUUID()`.
*
* @returns A new HyperResponse instance.
*/
Expand Down Expand Up @@ -214,7 +216,7 @@ component accessors="true" {
}

/**
* Returns true if the request status code is considered a server error.
* Returns true if the request status code is considered a server error (5xx status code).
*
* @returns boolean
*/
Expand Down

0 comments on commit 1ba168b

Please sign in to comment.