diff --git a/.travis.yml b/.travis.yml index 325db05..c17b97b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: php php: - - 5.4 - 5.5 - 5.6 + - 7.0 matrix: allow_failures: - - php: 5.4 + - php: 7.0 before_install: - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then COVERAGE="-c `php -i | grep 'xdebug.ini'` --coverage coverage.xml --coverage-src src/"; else COVERAGE="" && if [ $TRAVIS_PHP_VERSION = '5.6' ]; then phpenv config-rm xdebug.ini; fi; fi @@ -16,4 +16,4 @@ install: script: - vendor/bin/phpcs --standard=standards.xml --extensions=php --encoding=utf-8 -sp src/ - - vendor/bin/tester -p php $COVERAGE tests/ \ No newline at end of file + - vendor/bin/tester -p php $COVERAGE tests/ diff --git a/README.md b/README.md index 1c649a8..f7201a6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -Google Map API [![Latest Version on Packagist][ico-version]][link-packagist] [![Packagist](https://img.shields.io/packagist/dt/olicek/google-map-api.svg)](https://packagist.org/packages/olicek/google-map-api/stats) [![Build Status](https://travis-ci.org/Olicek/GoogleMapAPI.svg?branch=master)](https://travis-ci.org/Olicek/GoogleMapAPI) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Olicek/GoogleMapAPI/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Olicek/GoogleMapAPI/?branch=master) -========= +# Google Map API + +[![Latest stable](https://img.shields.io/packagist/v/olicek/google-map-api.svg)](https://packagist.org/packages/olicek/google-map-api) [![Packagist](https://img.shields.io/packagist/dt/olicek/google-map-api.svg)](https://packagist.org/packages/olicek/google-map-api/stats) [![Build Status](https://travis-ci.org/Olicek/GoogleMapAPI.svg?branch=master)](https://travis-ci.org/Olicek/GoogleMapAPI) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Olicek/GoogleMapAPI/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Olicek/GoogleMapAPI/?branch=master) + + This component is stated for Nette framework and it simlifies working with a Google map. Requirements diff --git a/src/MapAPI.php b/src/MapAPI.php index d69a25a..eb56304 100644 --- a/src/MapAPI.php +++ b/src/MapAPI.php @@ -23,10 +23,10 @@ class MapAPI extends Control const ROADMAP = 'ROADMAP', SATELLITE = 'SATELLITE', HYBRID = 'HYBRID', TERRAIN = 'TERRAIN', BICYCLING = 'BICYCLING', DRIVING = 'DRIVING', TRANSIT = 'TRANSIT', WALKING = 'WALKING'; - /** @var String */ + /** @var double|string */ private $width; - /** @var String */ + /** @var double|string */ private $height; /** @var array */ @@ -103,8 +103,8 @@ public function setCoordinates(array $coordinates) /** - * @param double $width - * @param double $height + * @param double|string $width + * @param double|string $height * @return MapAPI */ public function setProportions($width, $height) diff --git a/tests/GoogleAPI/MapAPITest.phpt b/tests/GoogleAPI/MapAPITest.phpt index e58f703..1025dac 100644 --- a/tests/GoogleAPI/MapAPITest.phpt +++ b/tests/GoogleAPI/MapAPITest.phpt @@ -58,6 +58,9 @@ class MapAPITest extends TestCase { $this->map->setProportions(150, 300); Assert::same(['width' => 150, 'height' => 300], $this->map->getProportions()); + + $this->map->setProportions('150px', '300px'); + Assert::same(['width' => '150px', 'height' => '300px'], $this->map->getProportions()); }