PointsCollection::total()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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