Weather   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 30
c 0
b 0
f 0
rs 10
ccs 4
cts 4
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 4 1
1
<?php
2
namespace Bhhaskin\WeatherBee\Util;
3
4
/**
5
 * Class for handling weather
6
 */
7
class Weather
8
{
9
    /**
10
     * Weather description.
11
     * @var string
12
     */
13
    public $description;
14
15
    /**
16
     * Weather icon.
17
     * @var string
18
     */
19
    public $icon;
20
21
    /**
22
     * Create Weather object.
23
     * @param string $description Weather description.
24
     * @param string $icon        Weather icon.
25
     */
26 1
    public function __construct(string $description, string $icon = null)
27
    {
28 1
        $this->description = $description;
29 1
        $this->icon = $icon;
30 1
    }
31
32
    public function __toString(): string
33
    {
34
        return $this->description;
35
    }
36
}
37