<commit_before># weather-forecast-php
weather-forecast-php is php wrapper implementation of [Dark Sky](https://darksky.net) Api (formerly [Forecast.io](http://forecast.io))

## Installation
Installation is really easy through [composer](http://getcomposer.org)
```
composer require sohelrana820/weather-forecast-php
```

## Usage

```php
<?php

use SohelRana820\Forecast\Forecast;

$forecast = new Forecast(API_KEY);
$forecast = new Forecast(API_KEY);
$forecast->setLatitude(DEFAULT_LATITUDE);
$forecast->setLongitude(DEFAULT_LATITUDE);
$response = $forecast->request();

// Retrieve the current weather data
var_dump($response->getCurrentlyData());

// Retrieve the hourly weather data
var_dump($response->getHourlyData());

// Retrieve the daily weather data
var_dump($response->getHourlyData());

// Retrieve weather data
var_dump($response->getFlags());

 ```
 
### How to set optional parameters.
 
This library allow to set all of their optional parameters (lng, units, etc)
 ```php
 <?php
 $forecast->setOptions($optionsArray = ['units' => 'si']);
 ```
 You can pass all optional parameter as array . See there all optional parameter [official documentation](https://darksky.net/dev/docs).<commit_msg>Update readme files<commit_after># weather-forecast-php
weather-forecast-php is php wrapper implementation of [Dark Sky](https://darksky.net) Api (formerly [Forecast.io](http://forecast.io))

## Installation
Installation is really easy through [composer](http://getcomposer.org)
```
composer require sohelrana820/weather-forecast-php
```

## Usage

```php
<?php

use SohelRana820\Forecast\Forecast;

$forecast = new Forecast(API_KEY);
$forecast->setLatitude(DEFAULT_LATITUDE);
$forecast->setLongitude(DEFAULT_LATITUDE);
$response = $forecast->request();

// Retrieve the current data
var_dump($response->getCurrentlyData());

// Retrieve the hourly data
var_dump($response->getHourlyData());

// Retrieve the daily data
var_dump($response->getDailyData());

// Retrieve weather flags
var_dump($response->getFlags());

 ```
 
### How to set optional parameters.
 
This library allow to set all of their optional parameters (lng, units, etc)
 ```php
 <?php
 $forecast->setOptions($optionsArray = ['units' => 'si']);
 ```
 You can pass all optional parameter as array . See there all optional parameter [official documentation](https://darksky.net/dev/docs).
{'fraction_non_alphanumeric': 0.14430808294540837, 'fraction_numerical': 0.0050782903089293275, 'mean_word_length': 5.7542857142857144, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2692524', 'n_tokens_mistral': 747, 'n_tokens_neox': 723, 'n_words': 191}