FOSSology
4.4.0
Open Source License Compliance by Open Source Software
ResponseHelper.php
Go to the documentation of this file.
1
<?php
2
/*
3
SPDX-FileCopyrightText: © 2021 Siemens AG
4
Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5
6
SPDX-License-Identifier: GPL-2.0-only
7
*/
8
13
namespace
Fossology\UI\Api\Helper
;
14
15
use Slim\Psr7\Response;
16
21
class
ResponseHelper
extends
Response
22
{
29
public
function
withJson
($arr,
int
$stat=200)
30
{
31
$this->getBody()->write(json_encode($arr));
32
return
$this->withHeader(
"Content-Type"
,
"application/json"
)
33
->withStatus($stat);
34
}
35
}
Fossology\UI\Api\Helper\ResponseHelper
Override Slim response for withJson function.
Definition:
ResponseHelper.php:22
Fossology\UI\Api\Helper\ResponseHelper\withJson
withJson($arr, int $stat=200)
Definition:
ResponseHelper.php:29
Fossology\UI\Api\Helper
REST api helper classes.
src
www
ui
api
Helper
ResponseHelper.php
Generated on Mon Nov 18 2024 07:37:14 for FOSSology by
1.9.1