CountableMethods::count()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PHPKitchen\Platform\Struct\Mixin;
4
5
/**
6
 * Represents implementation of countable interface for collections.
7
 *
8
 * @property array $elements data storage.
9
 *
10
 * @author Dmitry Kolodko <[email protected]>
11
 * @since 1.0
12
 */
13
trait CountableMethods {
14
    /**
15
     * Count elements of an object
16
     *
17
     * @link http://php.net/manual/en/countable.count.php
18
     * @return int count of elements.
19
     *
20
     * @since 1.0
21
     */
22
    public function count() {
23
        return count($this->elements);
24
    }
25
}