Git Product home page Git Product logo

google-places-library's Introduction

Google Places API Library

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

Extension library to interact with Google Places API

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require 2amigos/google-places-library

or add

"2amigos/google-places-library": "*"

to the require section of your composer.json file.

Usage

Using SearchClient class:

use Da\Google\Places\Client\SearchClient 

$search = new SearchClient('{YOURGOOGLEAPIKEY}');

// $search->forceJsonArrayResponse(); // if you want to get arrays instead of objects
// $search = new SearchClient('{YOURGOOGLEAPIKEY}', 'xml'); // if you wish to handle XML responses (JSON is highly recommended)


// If you setup the format in 'xml', the returned value will be an array.
// The library will decode the response automatically
var_dump($search->text('restaurants in Inca Mallorca'));

Using PlaceClient class:

use Da\Google\Places\Client\PlaceClient

$place = new PlaceClient('{YOURGOOGLEAPIKEY}');

// $place = new PlaceClient('{YOURGOOGLEAPIKEY}', 'xml'); // if you wish to handle XML responses (JSON is highly recommended)

$place->details('{REFERENCEIDOFPLACE}'));

Further Information

For further information regarding the multiple parameters of Google Places please visit its API reference

Contributing

Please see CONTRIBUTING for details.

Clean code

We have added some development tools for you to contribute to the library with clean code:

  • PHP mess detector: Takes a given PHP source code base and look for several potential problems within that source.
  • PHP code sniffer: Tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.
  • PHP code fixer: Analyzes some PHP source code and tries to fix coding standards issues.

And you should use them in that order.

Using php mess detector

Sample with all options available:

 ./vendor/bin/phpmd ./src text codesize,unusedcode,naming,design,controversial,cleancode

Using code sniffer

 ./vendor/bin/phpcs -s --report=source --standard=PSR2 ./src

Using code fixer

We have added a PHP code fixer to standardize our code. It includes Symfony, PSR2 and some contributors rules.

./vendor/bin/php-cs-fixer fix ./src

Testing

$ ./vendor/bin/phpunit

Credits

License

The BSD License (BSD). Please see License File for more information.


Custom Software Development | Web & Mobile Development Software
www.2amigos.us

google-places-library's People

Contributors

kurpievski avatar tonydspaniard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-places-library's Issues

Question about guzzle

Hello, does this library need guzzle 6?

I get this error when trying to update the Google Map Library extension:
Problem 1 - Installation request for 2amigos/yii2-google-places-library * -> satisfiable by 2amigos/yii2-google-places-library[0.1.0]. - 2amigos/yii2-google-places-library 0.1.0 requires guzzlehttp/guzzle 4.* -> satisfiable by guzzlehttp/guzzle[4.0.0, 4.0.0-rc.1, 4.0.0-rc.2, 4.0.1, 4.0.2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5, 4.1.6, 4.1.7, 4.1.8, 4.2.0, 4.2.1, 4.2.2, 4.2.3, 4.2.4, 4.x-dev] but these conflict with your requirements or minimum-stability.

Please make new release with last fixes

Composer 2amigos/yii2-google-places-library requires "2amigos/google-places-library": "^1.0", but last version of google-places-library is 1.0.1. So if I require "2amigos/yii2-google-places-library": "dev-master" it will not work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.