Workspace::timezone()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Timegridio\Concierge;
4
5
use Timegridio\Concierge\Models\Business;
6
7
class Workspace
8
{
9
    protected $business;
10
11
    protected $timezone = null;
12
13 15
    public function business($business)
14
    {
15 15
        $this->business = $business;
16
17 15
        $this->timezone($this->business->timezone);
18
19 15
        return $this;
20
    }
21
22 15
    public function timezone($timezone = null)
23
    {
24 15
        $this->timezone = ($timezone !== null) ?: $this->business->timezone;
25
26 15
        return $this;
27
    }
28
}
29