Skip to content

Add some missing Google Place API features and some fixes #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@

# PHPUnit
/phpunit.xml
/phpunit.xml.dist
/phpunit.ci.xml
/build

#PHPStorm folder
/.idea

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"php-http/cache-plugin": "^1.4",
"php-http/guzzle6-adapter": "^1.0",
"phpunit/phpunit": "^5.4",
"phpunit/phpunit-selenium": "dev-master",
"phpunit/phpunit-selenium": "^3.0",
"symfony/cache": "^3.2",
"symfony/phpunit-bridge": "^2.7|^3.0"
},
Expand Down
5 changes: 3 additions & 2 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ FROM php:latest

# APT packages
RUN apt-get update && apt-get install -y \
zlib1g-dev \
zlib1g-dev libzip-dev zip\
git \
&& rm -rf /var/lib/apt/lists/*

# PHP extensions
RUN docker-php-ext-install zip
RUN docker-php-ext-configure zip --with-libzip \
&& docker-php-ext-install zip

# XDebug extensions
RUN pecl install xdebug \
Expand Down
29 changes: 29 additions & 0 deletions src/Service/Place/Base/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ class Place
*/
private $reviews = [];

/**
* @var int|null
*/
private $userRatingsTotal;

/**
* @var string[]
*/
Expand Down Expand Up @@ -393,6 +398,30 @@ public function setRating($rating)
$this->rating = $rating;
}

/**
* @return bool
*/
public function hasUserRatingsTotal()
{
return $this->userRatingsTotal !== null;
}

/**
* @return int|null
*/
public function getUserRatingsTotal()
{
return $this->userRatingsTotal;
}

/**
* @param int|null $userRatingsTotal
*/
public function setUserRatingsTotal($userRatingsTotal)
{
$this->userRatingsTotal = $userRatingsTotal;
}

/**
* @return bool
*/
Expand Down
58 changes: 58 additions & 0 deletions src/Service/Place/Base/Review.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class Review
*/
private $authorUrl;

/**
* @var string|null
*/
private $profilePhotoUrl;

/**
* @var string|null
*/
Expand All @@ -41,6 +46,11 @@ class Review
*/
private $time;

/**
* @var string|null
*/
private $relativeTimeDescription;

/**
* @var string|null
*/
Expand Down Expand Up @@ -99,6 +109,30 @@ public function setAuthorUrl($authorUrl)
$this->authorUrl = $authorUrl;
}

/**
* @return bool
*/
public function hasProfilePhotoUrl()
{
return $this->profilePhotoUrl !== null;
}

/**
* @return string|null
*/
public function getProfilePhotoUrl()
{
return $this->profilePhotoUrl;
}

/**
* @param string|null $profilePhotoUrl
*/
public function setProfilePhotoUrl($profilePhotoUrl)
{
$this->profilePhotoUrl = $profilePhotoUrl;
}

/**
* @return bool
*/
Expand Down Expand Up @@ -171,6 +205,30 @@ public function setTime(\DateTime $time = null)
$this->time = $time;
}

/**
* @return bool
*/
public function hasRelativeTimeDescription()
{
return $this->relativeTimeDescription !== null;
}

/**
* @return string|null
*/
public function getRelativeTimeDescription()
{
return $this->relativeTimeDescription;
}

/**
* @param string|null $relativeTimeDescription
*/
public function setRelativeTimeDescription($relativeTimeDescription)
{
$this->relativeTimeDescription = $relativeTimeDescription;
}

/**
* @return bool
*/
Expand Down
Loading