Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/network-.../componen...
File: NetsPostsApiController.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Created by PhpStorm.
[2] Fix | Delete
* User: Andrew
[3] Fix | Delete
* Date: 10.06.2018
[4] Fix | Delete
* Time: 20:40
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace NetworkPosts\Components;
[8] Fix | Delete
[9] Fix | Delete
abstract class NetsPostsApiController {
[10] Fix | Delete
[11] Fix | Delete
const ERROR_CODE_LIST = array(
[12] Fix | Delete
400 => 'BAD_REQUEST',
[13] Fix | Delete
403 => 'ACCESS_RESTRICTED',
[14] Fix | Delete
404 => 'NOT_FOUND',
[15] Fix | Delete
500 => 'INTERNAL_ERROR'
[16] Fix | Delete
);
[17] Fix | Delete
[18] Fix | Delete
protected function send_response( $status_code, $text = null ){
[19] Fix | Delete
http_response_code( $status_code );
[20] Fix | Delete
if( $text ){
[21] Fix | Delete
echo $text;
[22] Fix | Delete
}
[23] Fix | Delete
$this->_exit();
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
protected function send_json( $status_code, $data ){
[27] Fix | Delete
if( !defined( 'NETSPOSTS_TEST' ) ) {
[28] Fix | Delete
header( 'Response-Type', 'application/json' );
[29] Fix | Delete
}
[30] Fix | Delete
$this->send_response( $status_code, json_encode( $data ) );
[31] Fix | Delete
}
[32] Fix | Delete
[33] Fix | Delete
protected function bad_request(){
[34] Fix | Delete
$this->send_response( 400, self::ERROR_CODE_LIST[400] );
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
protected function restricted(){
[38] Fix | Delete
$this->send_response( 403, self::ERROR_CODE_LIST[403] );
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
protected function not_found(){
[42] Fix | Delete
$this->send_response( 404, self::ERROR_CODE_LIST[404] );
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
protected function internal_exception(){
[46] Fix | Delete
$this->send_response( 500, self::ERROR_CODE_LIST[500] );
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
protected function _exit(){
[50] Fix | Delete
exit();
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function