Completed
Push — master ( 053977...560004 )
by Christopher
03:12
created

IsRecordable   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A totalHours() 0 4 1
1
<?php
2
3
namespace Chriscreates\Projects\Traits;
4
5
trait IsRecordable
6
{
7
    public function totalHours($rounded_up = false)
8
    {
9
        return $this->records->map->hours($rounded_up)->sum();
0 ignored issues
show
Bug introduced by
The property records does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
10
    }
11
}
12