I have the following class code in PHP:
<?php
require_once CUSTOM_PATH . DIRECTORY_SEPARATOR . 'myneighborlists.php';
class Action_Get_route extends Frapi_Action implements Frapi_Action_Interface
{
protected $requiredParams = array();
private $data = array();
public function toArray()
{
return $this->data;
}
public function executeAction()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
public function executeGet()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
public function executePost()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
public function executePut()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
public function executeDelete()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
public function executeHead()
{
$valid = $this->hasRequiredParameters($this->requiredParams);
if ($valid instanceof Frapi_Error) {
return $valid;
}
return $this->toArray();
}
}
This is basically a class template for the REST API, and when I call the get method, I always get a response new line. When I remove require_once, this new line will disappear. How to avoid this extra new line? This is what I meant by the new line.
source
share