SearchAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
c 0
b 0
f 0
dl 0
loc 31
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace Hexogen\KDTree\Interfaces;
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 42
    public function __construct(KDTreeInterface $tree)
22
    {
23 42
        $this->tree = $tree;
24 42
        $this->dimensions = $tree->getDimensionCount();
25 42
    }
26
27
    /**
28
     * Search items it the tree by given algorithm
29
     *
30
     * @api
31
     * @param PointInterface $point
32
     * @param int $resultLength
33
     * @return array
34
     */
35
    abstract public function search(PointInterface $point, int $resultLength = 1) : array;
36
}
37