ReviewCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 3
c 1
b 0
f 1
dl 0
loc 17
ccs 0
cts 2
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A parseItem() 0 4 2
1
<?php
2
/**
3
 * Copyright (c) 2019 - present
4
 * Google Maps PHP - ReviewCollection.php
5
 * author: Roberto Belotti - [email protected]
6
 * web : robertobelotti.com, github.com/biscolab
7
 * Initial version created on: 12/9/2019
8
 * MIT license: https://github.com/biscolab/google-maps-php/blob/master/LICENSE
9
 */
10
11
namespace Biscolab\GoogleMaps\Object;
12
13
use Biscolab\GoogleMaps\Abstracts\AbstractCollection;
14
15
/**
16
 * Class ReviewCollection
17
 * @package Biscolab\GoogleMaps\Object
18
 * @since v0.6.0
19
 */
20
class ReviewCollection extends AbstractCollection
21
{
22
23
	/**
24
	 * @var string
25
	 */
26
	protected $item_class = Review::class;
27
28
	/**
29
	 * @param $item
30
	 *
31
	 * @return Review
32
	 */
33
	protected function parseItem($item): Review
34
	{
35
36
		return ($item instanceof $this->item_class) ? $item : new $this->item_class($item);
37
	}
38
}