for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Manticoresearch\Endpoints;
use Manticoresearch\Request;
/**
* Class Bulk
* @package Manticoresearch\Endpoints
*/
class Bulk extends Request
{
* @return mixed|string
public function getPath()
return '/json/bulk';
}
public function getMethod()
return 'POST';
public function getContentType()
return 'application/x-ndjson';
* @param mixed $body
public function setBody($body = null)
if (is_array($body) || $body instanceof \Traversable) {
$this->body = '';
foreach ($body as $b) {
$this->body .= json_encode($b, true) . "\n";
true
integer
$flags
json_encode()
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
ignore-type
$this->body .= json_encode($b, /** @scrutinizer ignore-type */ true) . "\n";
} else {
$this->body = $body;