Skip to content

Commit

Permalink
[ENH] setup Response to use the ResponseContract
Browse files Browse the repository at this point in the history
  • Loading branch information
bim-g committed Sep 21, 2024
1 parent 5e71d32 commit 8c656c1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions src/Core/Http/Providers/Contracts/ResponseContract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/*
* Copyright (c) 2024. Wepesi Dev Framework
*/

namespace Wepesi\Core\Http\Providers\Contracts;

/**
*
*/
interface ResponseContract
{
/**
* @param array|string $data
* @param int $status
* @return mixed
*/
public static function send($data, int $status);

/**
* @param int $status_code
* @return mixed
*/
public static function setStatusCode(int $status_code);
}
4 changes: 3 additions & 1 deletion src/Core/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

namespace Wepesi\Core\Http;

use Wepesi\Core\Http\Providers\Contracts\ResponseContract;

/**
*
*/
class Response
class Response implements ResponseContract
{
/**
* @param $data
Expand Down

0 comments on commit 8c656c1

Please sign in to comment.