for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of product_management
* User: Sinan TURGUT <[email protected]>
* Date: 24.06.2019
* php version 7.2
*
* @category Assessment
* @package ProductManagement
* @author Sinan TURGUT <[email protected]>
* @license See LICENSE file
* @link https://dev.sinanturgut.com.tr
*/
namespace App\Utility;
* Class Response
* @package App\Utility
class Response
{
* Response constructor.
public function __construct()
//
}
* @param $succes
* @param $data
* @param int $httpCode
public static function write($succes, $data, $httpCode = 200)
http_response_code($httpCode);
if ($succes) {
$outPut=array('success'=>'true', 'data'=>$data);
} else {
$outPut=array('success'=>'false', 'error'=>$data);
echo json_encode($outPut, JSON_UNESCAPED_UNICODE);
exit;
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.