Completed
Push — master ( c60dd0...055fc0 )
by Basarab
03:24
created

SearchAbstract   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
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 31
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
search() 0 1 ?
1
<?php
2
3
namespace Hexogen\KDTree;
4
5
abstract class SearchAbstract
6
{
7
    /**
8
     * @var KDTreeInterface
9
     */
10
    protected $tree;
11
12
    /**
13
     * @var int
14
     */
15
    protected $dimensions;
16
17
    /**
18
     * SearchAbstract constructor.
19
     * @param KDTreeInterface $tree
20
     */
21 39
    public function __construct(KDTreeInterface $tree)
22
    {
23 39
        $this->tree = $tree;
24 39
        $this->dimensions = $tree->getDimensionCount();
25 39
    }
26
27
    /**
28
     * Search items it the tree by given algorithm
29
     *
30
     * @param PointInterface $point
31
     * @param int $resultLength
32
     * @return array
33
     */
34
    abstract public function search(PointInterface $point, int $resultLength = 1) : array;
35
}
36