PointsCollection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 6
dl 0
loc 32
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 3 1
A add() 0 5 1
A total() 0 3 1
1
<?php
2
3
namespace Hotrush\Polarcy;
4
5
class PointsCollection
6
{
7
    /**
8
     * @var Point[]
9
     */
10
    private $points = [];
11
12
    /**
13
     * @param Point $point
14
     * @return $this
15
     */
16
    public function add(Point $point)
17
    {
18
        $this->points[] = $point;
19
20
        return $this;
21
    }
22
23
    /**
24
     * @return Point[]
25
     */
26
    public function all()
27
    {
28
        return $this->points;
29
    }
30
31
    /**
32
     * @return int
33
     */
34
    public function total()
35
    {
36
        return count($this->points);
37
    }
38
}