Completed
Push — master ( d791dd...2d8ee5 )
by Ventaquil
02:14
created

toArray   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 10 2
1
<?php
2
3
namespace PHPAlgorithms\GraphTools\Traits;
4
5
trait toArray {
6
    public function toArray()
7
    {
8
        $properties = array();
9
10
        foreach ((new \ReflectionClass($this))->getProperties() as $reflectionProperty) {
11
            $properties[$reflectionProperty->getName()] = $this->{$reflectionProperty->getName()};
12
        }
13
14
        return $properties;
15
    }
16
}
17