Completed
Push — master ( 90ad1a...d4b41d )
by Bryan
10:33
created

Weather::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
ccs 0
cts 0
cp 0
nc 1
cc 1
eloc 2
nop 0
crap 2
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