Apply fixes from StyleCI

This commit is contained in:
Nabeel Shahzad
2018-08-26 18:51:47 +00:00
committed by StyleCI Bot
parent e95b3eb366
commit 3c32f2d89d
38 changed files with 61 additions and 51 deletions

View File

@@ -13,8 +13,9 @@ class ICAO
*
* @param null $country
*
* @return string
* @throws \Exception
*
* @return string
*/
public static function createHexCode($country = null)
{

View File

@@ -438,7 +438,7 @@ class Metar implements \ArrayAccess
if (array_key_exists('cavok', $this->result) && $this->result['cavok']) {
$this->result['category'] = 'VFR';
} else {
/** @noinspection NestedPositiveIfStatementsInspection */
/* @noinspection NestedPositiveIfStatementsInspection */
if (array_key_exists('cloud_height', $this->result) && array_key_exists('visibility', $this->result)) {
if ($this->result['cloud_height']['ft'] > 3000 && $this->result['visibility']['nmi'] > 5) {
$this->result['category'] = 'VFR';
@@ -567,6 +567,7 @@ class Metar implements \ArrayAccess
* Decodes TAF code if present.
*
* @param mixed $part
*
* @return bool
*/
private function get_taf($part)
@@ -772,7 +773,7 @@ class Metar implements \ArrayAccess
if ($found[1] === 'CAVOK' || $found[1] === '9999') {
$this->set_result_value('visibility', new Distance(10000, 'm'));
$this->set_result_value('visibility_report', 'Greater than 10 km');
/** @noinspection NotOptimalIfConditionsInspection */
/* @noinspection NotOptimalIfConditionsInspection */
if ($found[1] === 'CAVOK') {
$this->set_result_value('cavok', true);
$this->method += 4; // can skip the next 4 methods: visibility_min, runway_vr, present_weather, clouds

View File

@@ -14,19 +14,20 @@ class TimezonelistExtended extends Timezonelist
* @param string $continent
* @param bool $htmlencode
*
* @throws \Exception
* @throws \Exception
*
* @return string
* @throws \Exception
* @throws \Exception
*/
protected function formatTimezone($timezone, $continent, $htmlencode = true)
{
$time = new \DateTimeImmutable(null, new DateTimeZone($timezone));
$offset = $time->format('P');
if ($htmlencode) {
$offset = str_replace(['-', '+'], array(' − ', ' + '), $offset);
$offset = str_replace(['-', '+'], [' − ', ' + '], $offset);
}
$timezone = substr($timezone, \strlen($continent) + 1);
$timezone = str_replace(['St_', '_'], array('St. ', ' '), $timezone);
$timezone = str_replace(['St_', '_'], ['St. ', ' '], $timezone);
return '(GMT/UTC'.$offset.')'.self::WHITESPACE_SEP.$timezone;
}