Skip to content

Commit

Permalink
[RELEASE] 3.0.0 - TYPO3 v10
Browse files Browse the repository at this point in the history
- Add TYPO3 v10 support
- Drop TYPO3 v8 support
- Use strict types in all classes if possible
- Replace copyright header by newer version
  • Loading branch information
pascal20997 committed Jul 10, 2020
1 parent 12f65a6 commit ab80bcc
Show file tree
Hide file tree
Showing 32 changed files with 275 additions and 559 deletions.
15 changes: 6 additions & 9 deletions Classes/Ajax/DeutscherWetterdienstWarnCellSearch.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?php
namespace JWeiland\Weather2\Ajax;

declare(strict_types=1);

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* This file is part of the package jweiland/weather2.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
* LICENSE file that was distributed with this source code.
*/

namespace JWeiland\Weather2\Ajax;

use JWeiland\Weather2\Domain\Repository\DwdWarnCellRepository;
use TYPO3\CMS\Core\Http\Response;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down
20 changes: 9 additions & 11 deletions Classes/Controller/CurrentWeatherController.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?php

declare(strict_types=1);
namespace JWeiland\Weather2\Controller;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* This file is part of the package jweiland/weather2.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
* LICENSE file that was distributed with this source code.
*/

namespace JWeiland\Weather2\Controller;

use JWeiland\Weather2\Domain\Repository\CurrentWeatherRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

Expand All @@ -30,14 +26,16 @@ class CurrentWeatherController extends ActionController

public function __construct(CurrentWeatherRepository $currentWeatherRepository)
{
parent::__construct();
if (is_callable('parent::__construct')) {
parent::__construct();
}
$this->currentWeatherRepository = $currentWeatherRepository;
}

/**
* action show displays the newest CurrentWeather model
*/
public function showAction()
public function showAction(): void
{
$currentWeather = $this->currentWeatherRepository->findBySelection($this->settings['selection']);
$this->view->assign('currentWeather', $currentWeather);
Expand Down
16 changes: 6 additions & 10 deletions Classes/Controller/WeatherAlertController.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?php

declare(strict_types=1);
namespace JWeiland\Weather2\Controller;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* This file is part of the package jweiland/weather2.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
* LICENSE file that was distributed with this source code.
*/

namespace JWeiland\Weather2\Controller;

use JWeiland\Weather2\Domain\Repository\WeatherAlertRepository;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

Expand All @@ -39,7 +35,7 @@ public function injectWeatherAlertRepository(WeatherAlertRepository $weatherAler
/**
* action show displays the newest CurrentWeather model
*/
public function showAction()
public function showAction(): void
{
$this->view->assign(
'weatherAlerts',
Expand Down
46 changes: 20 additions & 26 deletions Classes/Domain/Model/CurrentWeather.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?php

declare(strict_types=1);
namespace JWeiland\Weather2\Domain\Model;

/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* This file is part of the package jweiland/weather2.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
* LICENSE file that was distributed with this source code.
*/

namespace JWeiland\Weather2\Domain\Model;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

/**
Expand Down Expand Up @@ -108,7 +104,7 @@ public function getSerializedArray(): string
/**
* @param string $serializedArray
*/
public function setSerializedArray(string $serializedArray)
public function setSerializedArray(string $serializedArray): void
{
$this->serializedArray = $serializedArray;
}
Expand All @@ -124,7 +120,7 @@ public function getTemperatureC(): float
/**
* @param float $temperatureC
*/
public function setTemperatureC(float $temperatureC)
public function setTemperatureC(float $temperatureC): void
{
$this->temperatureC = $temperatureC;
}
Expand All @@ -142,7 +138,7 @@ public function getPressureHpa(): int
*
* @param int $pressureHpa
*/
public function setPressureHpa(int $pressureHpa)
public function setPressureHpa(int $pressureHpa): void
{
$this->pressureHpa = $pressureHpa;
}
Expand All @@ -158,7 +154,7 @@ public function getHumidityPercentage(): int
/**
* @param int $humidityPercentage
*/
public function setHumidityPercentage(int $humidityPercentage)
public function setHumidityPercentage(int $humidityPercentage): void
{
$this->humidityPercentage = $humidityPercentage;
}
Expand All @@ -173,9 +169,8 @@ public function getMinTempC(): float

/**
* @param float $minTempC
* @return void
*/
public function setMinTempC(float $minTempC)
public function setMinTempC(float $minTempC): void
{
$this->minTempC = $minTempC;
}
Expand All @@ -191,7 +186,7 @@ public function getMaxTempC(): float
/**
* @param float $maxTempC
*/
public function setMaxTempC(float $maxTempC)
public function setMaxTempC(float $maxTempC): void
{
$this->maxTempC = $maxTempC;
}
Expand All @@ -207,7 +202,7 @@ public function getWindSpeedMPS(): float
/**
* @param float $windSpeedMPS
*/
public function setWindSpeedMPS(float $windSpeedMPS)
public function setWindSpeedMPS(float $windSpeedMPS): void
{
$this->windSpeedMPS = $windSpeedMPS;
}
Expand All @@ -233,9 +228,8 @@ public function getWindDirSection(): float

/**
* @param int $windDirectionDeg
* @return void
*/
public function setWindDirectionDeg(int $windDirectionDeg)
public function setWindDirectionDeg(int $windDirectionDeg): void
{
$this->windDirectionDeg = $windDirectionDeg;
}
Expand All @@ -251,7 +245,7 @@ public function getPopPercentage(): int
/**
* @param int $popPercentage
*/
public function setPopPercentage(int $popPercentage)
public function setPopPercentage(int $popPercentage): void
{
$this->popPercentage = $popPercentage;
}
Expand All @@ -267,7 +261,7 @@ public function getSnowVolume(): int
/**
* @param int $snowVolume
*/
public function setSnowVolume(int $snowVolume)
public function setSnowVolume(int $snowVolume): void
{
$this->snowVolume = $snowVolume;
}
Expand All @@ -283,7 +277,7 @@ public function getRainVolume(): int
/**
* @param int $rainVolume
*/
public function setRainVolume(int $rainVolume)
public function setRainVolume(int $rainVolume): void
{
$this->rainVolume = $rainVolume;
}
Expand All @@ -299,7 +293,7 @@ public function getCloudsPercentage(): int
/**
* @param int $cloudsPercentage
*/
public function setCloudsPercentage(int $cloudsPercentage)
public function setCloudsPercentage(int $cloudsPercentage): void
{
$this->cloudsPercentage = $cloudsPercentage;
}
Expand All @@ -315,7 +309,7 @@ public function getName(): string
/**
* @param string $name
*/
public function setName(string $name)
public function setName(string $name): void
{
$this->name = $name;
}
Expand All @@ -331,7 +325,7 @@ public function getMeasureTimestamp(): \DateTime
/**
* @param \DateTime $measureTimestamp
*/
public function setMeasureTimestamp(\DateTime $measureTimestamp)
public function setMeasureTimestamp(\DateTime $measureTimestamp): void
{
$this->measureTimestamp = $measureTimestamp;
}
Expand All @@ -347,7 +341,7 @@ public function getIcon(): string
/**
* @param string $icon
*/
public function setIcon(string $icon)
public function setIcon(string $icon): void
{
$this->icon = $icon;
}
Expand Down
22 changes: 9 additions & 13 deletions Classes/Domain/Model/DwdWarnCell.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?php

declare(strict_types=1);
namespace JWeiland\Weather2\Domain\Model;

/*
* This file is part of the project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
* This file is part of the package jweiland/weather2.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
* LICENSE file that was distributed with this source code.
*/

namespace JWeiland\Weather2\Domain\Model;

use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;

/**
Expand Down Expand Up @@ -53,7 +49,7 @@ public function getWarnCellId(): string
/**
* @param string $warnCellId
*/
public function setWarnCellId(string $warnCellId)
public function setWarnCellId(string $warnCellId): void
{
$this->warnCellId = $warnCellId;
}
Expand All @@ -69,7 +65,7 @@ public function getName(): string
/**
* @param string $name
*/
public function setName(string $name)
public function setName(string $name): void
{
$this->name = $name;
}
Expand All @@ -85,7 +81,7 @@ public function getShortName(): string
/**
* @param string $shortName
*/
public function setShortName(string $shortName)
public function setShortName(string $shortName): void
{
$this->shortName = $shortName;
}
Expand All @@ -101,7 +97,7 @@ public function getSign(): string
/**
* @param string $sign
*/
public function setSign(string $sign)
public function setSign(string $sign): void
{
$this->sign = $sign;
}
Expand Down
Loading

0 comments on commit ab80bcc

Please sign in to comment.