src/M6Web/Bundle/ElasticsearchBundle/Handler/EventHandler.php
protected function extractTookFromResponse(array $response)
    {
        if (is_null($response['body'])) {
            return null;
        }
        $content = stream_get_contents($response['body']);
        rewind($response['body']);

        if (preg_match('/\"took\":(\d+)/', $content, $matches)) {
            return (int) $matches[1];
        }

        return null;
    }
protected function extractTookFromResponse(array $response)
    {
        if (is_null($response['body'])) {
            return null;
        }
        $content = stream_get_contents($response['body']);
        rewind($response['body']);

        if (preg_match('/\"took\":(\d+)/', $content, $matches)) {
            return (int) $matches[1];
        }

        return null;
    }
protected function extractTookFromResponse ( array $ response ) { if ( is_null ( $ response [ 'body' ] ) ) { return null ; } $ content = stream_get_contents ( $ response [ 'body' ] ) ; rewind ( $ response [ 'body' ] ) ; if ( preg_match ( '/\"took\":(\d+)/' , $ content , $ matches ) ) { return ( int ) $ matches [ 1 ] ; } return null ; }
Extract took from response

@param array $response

@return int|null
Extract took from response