Completed
Pull Request — master (#1832)
by
unknown
02:20
created

AbstractQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A _getBaseName() 0 7 1
1
<?php
2
3
namespace Elastica\Query;
4
5
use Elastica\Param;
6
use Elastica\Util;
7
8
/**
9
 * Abstract query object. Should be extended by all query types.
10
 *
11
 * @author Nicolas Ruflin <[email protected]>
12
 */
13
abstract class AbstractQuery extends Param
14
{
15
    protected function _getBaseName()
16
    {
17
        $shortName = (new \ReflectionClass($this))->getShortName();
18
        $shortName = \preg_replace('/Query$/', '', $shortName);
19
20
        return Util::toSnakeCase($shortName);
21
    }
22
}
23