Test Failed
Push — master ( c589a4...66fb05 )
by Roberto
06:10 queued 12s
created

TimeZoneResult::getFieldName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright (c) 2019 - present
4
 * Google Maps PHP - TimeZoneResult.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 8/10/2019
8
 * MIT license: https://github.com/biscolab/google-maps-php/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\GoogleMaps\Http\Result;
12
13
use Biscolab\GoogleMaps\Fields\GoogleMapsResultFields;
14
use Biscolab\GoogleMaps\Http\GoogleMapsResult;
15
16
/**
17
 * Class TimeZoneResult
18
 *
19
 * @method setDstOffset(int $dstOffset)
20
 * @method setRawOffset(int $rawOffset)
21
 * @method setTimeZoneId(string $timeZoneId)
22
 * @method setTimeZoneName(string $timeZoneName)
23
 *
24
 * @method int getDstOffset()
25
 * @method int getRawOffset()
26
 * @method string getTimeZoneId()
27
 * @method string getTimeZoneName()
28
 * @since   0.7.0
29
 */
30
class TimeZoneResult extends GoogleMapsResult
31
{
32
33
	/**
34
	 * @var int
35
	 */
36
	protected $dstOffset = 0;
37
38
	/**
39
	 * @var int
40
	 */
41
	protected $rawOffset = 0;
42
43
	/**
44
	 * @var string
45
	 */
46
	protected $timeZoneId = '';
47
48
	/**
49
	 * @var string
50
	 */
51
	protected $timeZoneName = '';
52
53
	/**
54
	 * @var array
55
	 */
56
	protected $typeCheck = [
57
		GoogleMapsResultFields::DST_OFFSET    => 'int',
58
		GoogleMapsResultFields::RAW_OFFSET    => 'int',
59
		GoogleMapsResultFields::TIMEZONE_ID   => 'string',
60
		GoogleMapsResultFields::TIMEZONE_NAME => 'string',
61
	];
62
63
	/**
64
	 * @param string $initial_field_name
65
	 *
66
	 * @return string
67
	 */
68
	protected function getFieldName(string $initial_field_name): string
69
	{
70
71
		return lcfirst($initial_field_name);
72
	}
73
74
}