IteratorMethods   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 3 1
1
<?php
2
3
namespace PHPKitchen\Platform\Struct\Mixin;
4
5
use ArrayIterator;
6
7
/**
8
 * Represents implementation of  iterator interface for collections.
9
 *
10
 * @property array $elements data storage.
11
 *
12
 * @author Dmitry Kolodko <[email protected]>
13
 * @since 1.0
14
 */
15
trait IteratorMethods {
16
    /**
17
     * Get an iterator for the items.
18
     *
19
     * @return \ArrayIterator
20
     * 
21
     * @since 1.0
22
     */
23
    public function getIterator() {
24
        return new ArrayIterator($this->elements);
25
    }
26
}