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

AbstractQuery::_getBaseName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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