ElasticsearchGetDocumentCheckException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 20
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A emptyIndex() 0 4 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