Skip to content

Commit f3c0202

Browse files
committed
Executed "Reformat code".
1 parent 8171aaa commit f3c0202

File tree

10 files changed

+43
-41
lines changed

10 files changed

+43
-41
lines changed

Cmfcmf/OpenWeatherMap.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ class OpenWeatherMap
7777
/**
7878
* Constructs the OpenWeatherMap object.
7979
*
80-
* @param null|FetcherInterface $fetcher The interface to fetch the data from OpenWeatherMap. Defaults to
81-
* CurlFetcher() if cURL is available. Otherwise defaults to
82-
* FileGetContentsFetcher() using 'file_get_contents()'.
80+
* @param null|FetcherInterface $fetcher The interface to fetch the data from OpenWeatherMap. Defaults to
81+
* CurlFetcher() if cURL is available. Otherwise defaults to
82+
* FileGetContentsFetcher() using 'file_get_contents()'.
8383
* @param bool|string $cacheClass If set to false, caching is disabled. Otherwise this must be a class
84-
* extending AbstractCache. Defaults to false.
85-
* @param int $seconds How long weather data shall be cached. Default 10 minutes.
84+
* extending AbstractCache. Defaults to false.
85+
* @param int $seconds How long weather data shall be cached. Default 10 minutes.
8686
*
8787
* @throws \Exception If $cache is neither false nor a valid callable extending Cmfcmf\OpenWeatherMap\Util\Cache.
8888
* @api
@@ -112,7 +112,7 @@ public function __construct($fetcher = null, $cacheClass = false, $seconds = 600
112112
*
113113
* @param array|int|string $query The place to get weather information for. For possible values see below.
114114
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
115-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
115+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
116116
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
117117
*
118118
* @throws OpenWeatherMap\Exception If OpenWeatherMap returns an error.
@@ -175,9 +175,9 @@ public function getWeather($query, $units = 'imperial', $lang = 'en', $appid = '
175175
*
176176
* @param array|int|string $query The place to get weather information for. For possible values see below.
177177
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
178-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
178+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
179179
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
180-
* @param int $days For how much days you want to get a forecast. Default 1, maximum: 14.
180+
* @param int $days For how much days you want to get a forecast. Default 1, maximum: 14.
181181
*
182182
* @throws OpenWeatherMap\Exception If OpenWeatherMap returns an error.
183183
* @throws \InvalidArgumentException If an argument error occurs.
@@ -248,7 +248,7 @@ public function getWeatherForecast($query, $units = 'imperial', $lang = 'en', $a
248248
* @param int $endOrCount
249249
* @param string $type
250250
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
251-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
251+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
252252
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
253253
*
254254
* @throws OpenWeatherMap\Exception If OpenWeatherMap returns an error.
@@ -310,9 +310,9 @@ public function getRawData($query, $units = 'imperial', $lang = 'en', $appid = '
310310
*
311311
* @param array|int|string $query The place to get weather information for. For possible values see below.
312312
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
313-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
313+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
314314
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
315-
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default).
315+
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default).
316316
*
317317
* @return string Returns false on failure and the fetched data in the format you specified on success.
318318
*
@@ -356,9 +356,9 @@ public function getRawWeatherData($query, $units = 'imperial', $lang = 'en', $ap
356356
*
357357
* @param array|int|string $query The place to get weather information for. For possible values see below.
358358
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
359-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
359+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
360360
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
361-
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default).
361+
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default).
362362
*
363363
* @return string Returns false on failure and the fetched data in the format you specified on success.
364364
*
@@ -402,10 +402,10 @@ public function getRawHourlyForecastData($query, $units = 'imperial', $lang = 'e
402402
*
403403
* @param array|int|string $query The place to get weather information for. For possible values see below.
404404
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
405-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
405+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
406406
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
407-
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default)
408-
* @param int $cnt How many days of forecast shall be returned? Maximum (and default): 14
407+
* @param string $mode The format of the data fetched. Possible values are 'json', 'html' and 'xml' (default)
408+
* @param int $cnt How many days of forecast shall be returned? Maximum (and default): 14
409409
*
410410
* @throws \InvalidArgumentException If $cnt is higher than 14.
411411
* @return string Returns false on failure and the fetched data in the format you specified on success.
@@ -451,16 +451,16 @@ public function getRawDailyForecastData($query, $units = 'imperial', $lang = 'en
451451
/**
452452
* Directly returns the xml/json/html string returned by OpenWeatherMap for the daily forecast.
453453
*
454-
* @param array|int|string $query The place to get weather information for. For possible values see below.
455-
* @param \DateTime $start The \DateTime object of the date to get the first weather information from.
456-
* @param \DateTime|int $endOrCount Can be either a \DateTime object representing the end of the period to
457-
* receive weather history data for or an integer counting the number of
454+
* @param array|int|string $query The place to get weather information for. For possible values see below.
455+
* @param \DateTime $start The \DateTime object of the date to get the first weather information from.
456+
* @param \DateTime|int $endOrCount Can be either a \DateTime object representing the end of the period to
457+
* receive weather history data for or an integer counting the number of
458458
* reports requested.
459-
* @param string $type The period of the weather history requested. Can be either be either "tick",
460-
* "hour" or "day".
461-
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
462-
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
463-
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
459+
* @param string $type The period of the weather history requested. Can be either be either "tick",
460+
* "hour" or "day".
461+
* @param string $units Can be either 'metric' or 'imperial' (default). This affects almost all units returned.
462+
* @param string $lang The language to use for descriptions, default is 'en'. For possible values see below.
463+
* @param string $appid Your app id, default ''. See http://openweathermap.org/appid for more details.
464464
*
465465
* @throws \InvalidArgumentException
466466
*

Cmfcmf/OpenWeatherMap/Forecast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Forecast extends CurrentWeather
3838
/**
3939
* Create a new weather object for forecasts.
4040
*
41-
* @param \SimpleXMLElement $xml The forecasts xml.
41+
* @param \SimpleXMLElement $xml The forecasts xml.
4242
* @param string $units Ths units used.
4343
*
4444
* @internal

Cmfcmf/OpenWeatherMap/Util/City.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class City
5454
/**
5555
* Create a new city object.
5656
*
57-
* @param int $id The city id.
58-
* @param string $name The name of the city.
59-
* @param float $lon The longitude of the city.
60-
* @param float $lat The latitude of the city.
61-
* @param string $country The abbreviation of the country the city is located in
57+
* @param int $id The city id.
58+
* @param string $name The name of the city.
59+
* @param float $lon The longitude of the city.
60+
* @param float $lat The latitude of the city.
61+
* @param string $country The abbreviation of the country the city is located in
6262
* @param int $population The city's population.
6363
*
6464
* @internal

Cmfcmf/OpenWeatherMap/Util/Sun.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Sun
3535
* Create a new sun object.
3636
*
3737
* @param \DateTime $rise The time of the sun rise
38-
* @param \DateTime $set The time of the sun set.
38+
* @param \DateTime $set The time of the sun set.
3939
*
4040
* @throws \LogicException If sunset is before sunrise.
4141
* @internal

Cmfcmf/OpenWeatherMap/Util/Time.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ class Time
4747
public function __construct($from, $to = null)
4848
{
4949
if (isset($to)) {
50-
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string) $from);
51-
$to = ($to instanceof \DateTime) ? $to : new \DateTime((string) $to);
50+
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from);
51+
$to = ($to instanceof \DateTime) ? $to : new \DateTime((string)$to);
5252
$day = new \DateTime($from->format('Y-m-d'));
5353
} else {
54-
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string) $from);
54+
$from = ($from instanceof \DateTime) ? $from : new \DateTime((string)$from);
5555
$day = clone $from;
5656
$to = clone $from;
5757
$to = $to->add(new \DateInterval('PT23H59M59S'));

Cmfcmf/OpenWeatherMap/Util/Unit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class Unit
4545
/**
4646
* Create a new unit object.
4747
*
48-
* @param float $value The value.
49-
* @param string $unit The unit of the value.
48+
* @param float $value The value.
49+
* @param string $unit The unit of the value.
5050
* @param string $description The description of the value.
5151
*
5252
* @internal

Cmfcmf/OpenWeatherMap/Util/Weather.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class Weather
4646
/**
4747
* Create a new weather object.
4848
*
49-
* @param int $id The icon id.
49+
* @param int $id The icon id.
5050
* @param string $description The weather description.
51-
* @param string $icon The icon name.
51+
* @param string $icon The icon name.
5252
*
5353
* @internal
5454
*/

Cmfcmf/OpenWeatherMap/Util/Wind.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Wind
3434
/**
3535
* Create a new wind object.
3636
*
37-
* @param Unit $speed The wind speed.
37+
* @param Unit $speed The wind speed.
3838
* @param Unit $direction The wind direction.
3939
*
4040
* @internal

Cmfcmf/OpenWeatherMap/WeatherForecast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class WeatherForecast implements \Iterator
5959
*
6060
* @param $xml
6161
* @param string $units
62-
* @param int $days How many days of forecast to receive.
62+
* @param int $days How many days of forecast to receive.
6363
*
6464
* @internal
6565
*/

Examples/Cache.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ public function isCached($url)
5353
$path = $this->urlToPath($url);
5454
if (!file_exists($path) || filectime($path) + $this->seconds < time()) {
5555
echo "Weather data is NOT cached!\n";
56+
5657
return false;
5758
}
5859

5960
echo "Weather data is cached!\n";
61+
6062
return true;
6163
}
6264

0 commit comments

Comments
 (0)