CountableTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A count() 0 2 1
1
<?php
2
/**
3
 * Trait CountableTrait
4
 *
5
 * @filesource   CountableTrait.php
6
 * @created      03.12.2017
7
 * @package      chillerlan\Traits\SPL
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2017 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\Traits\SPL;
14
15
/**
16
 * @implements \Countable
17
 *
18
 * @link http://php.net/manual/class.countable.php
19
 */
20
trait CountableTrait{
21
22
	/**
23
	 * @var array
24
	 */
25
	protected $array = [];
26
27
	/**
28
	 * @link http://php.net/manual/countable.count.php
29
	 * @inheritdoc
30
	 */
31
	public function count():int{
32
		return \count($this->array);
33
	}
34
35
}
36