Skip to content

Commit

Permalink
Merge pull request #2 from fbonzon/clean
Browse files Browse the repository at this point in the history
Consistently use 4 spaces instead of tabs
  • Loading branch information
imelgrat authored Feb 13, 2017
2 parents e152f45 + 9df68e0 commit 08d1847
Show file tree
Hide file tree
Showing 6 changed files with 658 additions and 661 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ google-time-zone
[![Latest Stable Version](https://poser.pugx.org/imelgrat/google-time-zone/v/stable)](https://packagist.org/packages/imelgrat/google-time-zone)
[![Total Downloads](https://poser.pugx.org/imelgrat/google-time-zone/downloads)](https://packagist.org/packages/imelgrat/google-time-zone)

A PHP wrapper for the Google Maps TimeZone API.
A PHP wrapper for the Google Maps Time Zone API.

Developed by [Ivan Melgrati](https://twitter.com/imelgrat)
Developed by [Ivan Melgrati](https://twitter.com/imelgrat)

Requirements
------------
Expand Down Expand Up @@ -36,9 +36,9 @@ be found over at [Packagist](http://packagist.org).

### Manually

1. Copy `src/google-time-zone.php` to your codebase, perhaps to the `vendor`
1. Copy `src/GoogleMapsTimeZone.php` to your codebase, perhaps to the `vendor`
directory.
2. Add the `google-time-zone` class to your autoloader or `require` the file
2. Add the `GoogleMapsTimeZone` class to your autoloader or `require` the file
directly.

Feedback
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "imelgrat/google-time-zone",
"type": "library",
"version" : "1.2.0",
"description": "A PHP wrapper for the Google Maps TimeZone API.",
"description": "A PHP wrapper for the Google Maps Time Zone API.",
"keywords": ["google", "map", "maps", "gmap", "gmaps", "timezone", "time zone", "location"],
"homepage": "https://github.com/imelgrat/google-time-zone",
"license": "MIT",
Expand Down
123 changes: 61 additions & 62 deletions examples/example-all-parameters.php
Original file line number Diff line number Diff line change
@@ -1,63 +1,62 @@
<?php
/**
* This section includes a sample query that demonstrate features of the API.
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012.
*
* @author Ivan Melgrati
* @copyright 2016
* @package GoogleMapsTimeZone
* @author Ivan Melgrati
* @version v1.0.0 stable
*/

require_once ('../src/GoogleMapsTimeZone.php');

/**
* All queries require an API key from Google
* @link https://developers.google.com/maps/documentation/timezone/get-api-key
* */
define('API_KEY', 'YOUR API KEY HERE');

// Create GoogleMapsTimeZone object with default properties
$timezone_object = new GoogleMapsTimeZone();

// Set Google API key
$timezone_object->setApiKey(API_KEY);

// Set XML as query return format
$timezone_object->setFormat($timezone_object::FORMAT_XML);

// Set Spanish as query return language
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages
$timezone_object->setLanguage('es');

// Set latitude (Mexico City International Airport)
$timezone_object->setLatitude(19.4360812);

// Set longitude (Mexico City International Airport)
$timezone_object->setLongitude(-99.074097);

// Set Timestamp (server-side current time)
$timezone_object->setTimestamp(time());

// Perform query
$timezone_data = $timezone_object->queryTimeZone();

echo '<pre>';
print_r($timezone_data);
echo '</pre>';


// Set XML as query return format
$timezone_object->setFormat($timezone_object::FORMAT_JSON);
// Set Arabic as query return language
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages
$timezone_object->setLanguage('ar');

// Perform query
$timezone_data = $timezone_object->queryTimeZone();

echo '<pre>';
var_dump($timezone_data);
echo '</pre>';
?>

/**
* This section includes a sample query that demonstrate features of the API.
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012.
*
* @author Ivan Melgrati
* @copyright 2016
* @package GoogleMapsTimeZone
* @author Ivan Melgrati
* @version v1.2.0 stable
*/

require_once('../src/GoogleMapsTimeZone.php');

/**
* All queries require an API key from Google.
* @link https://developers.google.com/maps/documentation/timezone/get-api-key
*/
define('API_KEY', 'YOUR API KEY HERE');

// Create GoogleMapsTimeZone object with default properties.
$timezone_object = new GoogleMapsTimeZone();

// Set Google API key.
$timezone_object->setApiKey(API_KEY);

// Set XML as query return format.
$timezone_object->setFormat($timezone_object::FORMAT_XML);

// Set Spanish as query return language.
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages
$timezone_object->setLanguage('es');

// Set latitude (Mexico City International Airport).
$timezone_object->setLatitude(19.4360812);

// Set longitude (Mexico City International Airport).
$timezone_object->setLongitude(-99.074097);

// Set Timestamp (server-side current time).
$timezone_object->setTimestamp(time());

// Perform query
$timezone_data = $timezone_object->queryTimeZone();

echo '<pre>';
print_r($timezone_data);
echo '</pre>';

// Set XML as query return format.
$timezone_object->setFormat($timezone_object::FORMAT_JSON);
// Set Arabic as query return language.
// Checkhttps://developers.google.com/maps/faq#languagesupport for a list of supported languages
$timezone_object->setLanguage('ar');

// Perform query.
$timezone_data = $timezone_object->queryTimeZone();

echo '<pre>';
var_dump($timezone_data);
echo '</pre>';
58 changes: 29 additions & 29 deletions examples/example-basic.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<?php
/**
* This section includes a sample query that demonstrate features of the API.
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012.
*
* @author Ivan Melgrati
* @copyright 2016
* @package GoogleMapsTimeZone
* @author Ivan Melgrati
* @version v1.0.0 stable
*/

require_once ('../src/GoogleMapsTimeZone.php');

/**
* All queries require an API key from Google
* @link https://developers.google.com/maps/documentation/timezone/get-api-key
* */
define('API_KEY', 'YOUR API KEY HERE');
/**
* This section includes a sample query that demonstrate features of the API.
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012.
*
* @author Ivan Melgrati
* @copyright 2016
* @package GoogleMapsTimeZone
* @author Ivan Melgrati
* @version v1.2.0 stable
*/

// Initialize GoogleMapsTimeZone object
$timezone_object = new GoogleMapsTimeZone(37.7697, -122.3933, 1331161200, GoogleMapsTimeZone::FORMAT_JSON);

// Set Google API key
$timezone_object->setApiKey(API_KEY);

// Perform query
$timezone_data = $timezone_object->queryTimeZone();
require_once('../src/GoogleMapsTimeZone.php');

echo '<pre>';
print_r($timezone_data);
echo '</pre>';
?>
/**
* All queries require an API key from Google.
* @link https://developers.google.com/maps/documentation/timezone/get-api-key
*/
define('API_KEY', 'YOUR API KEY HERE');

// Initialize GoogleMapsTimeZone object.
$timezone_object = new GoogleMapsTimeZone(37.7697, -122.3933, 1331161200, GoogleMapsTimeZone::FORMAT_JSON);

// Set Google API key.
$timezone_object->setApiKey(API_KEY);

// Perform query.
$timezone_data = $timezone_object->queryTimeZone();

echo '<pre>';
print_r($timezone_data);
echo '</pre>';
2 changes: 1 addition & 1 deletion phpdoc.dist.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdoc>
<title>GoogleTimeZone - A PHP wrapper for the Google Maps TimeZone API.</title>
<title>GoogleTimeZone - A PHP wrapper for the Google Maps Time Zone API.</title>
<parser>
<target>docs</target>
</parser>
Expand Down
Loading

0 comments on commit 08d1847

Please sign in to comment.