emptyIndex()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 4
crap 1
1
<?php
2
3
namespace TonicHealthCheck\Check\Elasticsearch\GetDocument;
4
5
use TonicHealthCheck\Check\Elasticsearch\ElasticsearchCheckException;
6
7
/**
8
 * Class ElasticsearchGetDocumentCheckException.
9
 */
10
class ElasticsearchGetDocumentCheckException extends ElasticsearchCheckException
11
{
12
    const EXCEPTION_NAME = 'ElasticsearchGetDocumentCheck';
13
14
    const CODE_MIN_SIZE_INDEX = 5002;
15
    const TEXT_MIN_SIZE_INDEX = 'index:%s type:%s has %d element min count is %d';
16
17
    /**
18
     * @param string $index
19
     * @param string $type
20
     * @param int    $size
21
     * @param int    $minSize
22
     *
23
     * @return ElasticsearchGetDocumentCheckException
24
     */
25 1
    public static function emptyIndex($index, $type, $size, $minSize)
26
    {
27 1
        return new self(sprintf(self::TEXT_MIN_SIZE_INDEX, $index, $type, $size, $minSize), self::CODE_MIN_SIZE_INDEX);
28
    }
29
}
30