Skip to content

Commit

Permalink
Default callables to null
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsingh87 committed Dec 31, 2022
1 parent 3103364 commit cc3a5dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function authorize()
$this->apiKey = substr($headers['authorization'], strlen("Basic "));
}

public function get(callable $get)
public function get(callable $get = null)
{
try {
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
Expand All @@ -50,7 +50,7 @@ public function get(callable $get)
}
}

public function post(callable $post)
public function post(callable $post = null)
{
try {
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
Expand All @@ -67,7 +67,7 @@ public function post(callable $post)
}
}

public function put(callable $put)
public function put(callable $put = null)
{
try {
if ($_SERVER['REQUEST_METHOD'] === 'PUT') {
Expand All @@ -84,7 +84,7 @@ public function put(callable $put)
}
}

public function delete(callable $delete)
public function delete(callable $delete = null)
{
try {
if ($_SERVER['REQUEST_METHOD'] === 'DELETE') {
Expand Down

0 comments on commit cc3a5dc

Please sign in to comment.