Skip to content

Commit

Permalink
feat(Req): 增加 isPatchisPutisDelete 方法
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Nov 1, 2024
1 parent f260061 commit 6aaefe0
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/Req.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,36 @@ public function isPost()
return $this->isMethod('POST');
}

/**
* Check if the current request method is PATCH
*
* @return bool
*/
public function isPatch(): bool
{
return $this->isMethod('PATCH');
}

/**
* Check if the current request method is PUT
*
* @return bool
*/
public function isPut(): bool
{
return $this->isMethod('PUT');
}

/**
* Check if the current request method is DELETE
*
* @return bool
*/
public function isDelete(): bool
{
return $this->isMethod('DELETE');
}

/**
* Check if the current request is an ajax(XMLHttpRequest) request
*
Expand Down

0 comments on commit 6aaefe0

Please sign in to comment.