Skip to content

JohnAmadis/googleapi-php-symfony

Repository files navigation

GoogleApi

API for handling of the geocode

This Symfony bundle is automatically generated by the Swagger Codegen project:

  • API version: 1.0.5
  • Build package: io.swagger.codegen.languages.SymfonyServerCodegen

Requirements

PHP 5.4.0 and later

Installation & Usage

To install the dependencies via Composer, add the following repository to composer.json of your Symfony project:

{
    "repositories": [{
        "type": "vcs",
        "url": "https://github.com/JohnAmadis/googleapi-php-symfony"
    }],
}

Then run:

composer require google/googleapi-server:1.0.5 -n

to add the generated swagger bundle as a dependency.

Tests

To run the unit tests for the generated bundle, first navigate to the directory containing the code, then run the following commands:

composer install
./vendor/bin/phpunit

Getting Started

Step 1: Please follow the installation procedure first.

Step 2: Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new GoogleApi\Server\GoogleApiBundle(),
        // ...
    );
}

Step 3: Register the routes:

# app/config/routing.yml
google_api:
    resource: "@GoogleApiBundle/Resources/config/routing.yml"

Step 4: Implement the API calls:

<?php
// src/Acme/MyBundle/Api/GeocodeApiInterface.php

namespace Acme\MyBundle\Api;

use GoogleApi\Server\Api\GeocodeApiInterface;

class GeocodeApi implements GeocodeApiInterface // An interface is autogenerated
{

    // Other operation methods ...
}

Step 5: Tag your API implementation:

# src/Acme/MyBundle/Resources/services.yml
services:
    # ...
    acme.my_bundle.api.geocode:
        class: Acme\MyBundle\Api\GeocodeApi
        tags:
            - { name: "google_api.api", api: "geocode" }
    # ...

Now you can start using the bundle!

Documentation for API Endpoints

All URIs are relative to https://maps.googleapis.com/maps/api

Class Method HTTP request Description
GeocodeApiInterface getInformation GET /geocode/json Gets Geo-Information about the specified place

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors