From: Raphaƫl Gertz Date: Wed, 2 Dec 2026 23:57:10 +0000 (+0100) Subject: Fix configure prototype X-Git-Tag: 0.6.0~9 X-Git-Url: https://git.rapsys.eu/airbundle/commitdiff_plain/5d8fd5f9342a01c795a70552ccac43fb6441116f?ds=inline Fix configure prototype Drop deprecated curl_close function --- diff --git a/Command/AttributeCommand.php b/Command/AttributeCommand.php index f4fa133..ac10d9a 100644 --- a/Command/AttributeCommand.php +++ b/Command/AttributeCommand.php @@ -26,7 +26,7 @@ class AttributeCommand extends DoctrineCommand { const SUCCESS = 0; ///Configure attribute command - protected function configure() { + protected function configure(): void { //Configure the class $this //Set name diff --git a/Command/RekeyCommand.php b/Command/RekeyCommand.php index 4ad8dfc..687ec1d 100644 --- a/Command/RekeyCommand.php +++ b/Command/RekeyCommand.php @@ -25,7 +25,7 @@ class RekeyCommand extends DoctrineCommand { /** * Configure attribute command */ - protected function configure() { + protected function configure(): void { //Configure the class $this //Set name diff --git a/Command/WeatherCommand.php b/Command/WeatherCommand.php index a7572b0..4bce668 100644 --- a/Command/WeatherCommand.php +++ b/Command/WeatherCommand.php @@ -75,27 +75,15 @@ class WeatherCommand extends DoctrineCommand { ]; ///Set curl handler - private $ch = null; - - ///Set manager registry - private $doctrine; - - ///Set filesystem - private $filesystem; + private \CurlHandle|false $ch = false; ///Weather command constructor - public function __construct(ManagerRegistry $doctrine, Filesystem $filesystem) { + public function __construct(private ManagerRegistry $doctrine, private Filesystem $filesystem) { parent::__construct($doctrine); - - //Set entity manager - $this->doctrine = $doctrine; - - //Set filesystem - $this->filesystem = $filesystem; } ///Configure attribute command - protected function configure() { + protected function configure():void { //Configure the class $this //Set name @@ -504,9 +492,6 @@ class WeatherCommand extends DoctrineCommand { //Flush to get the ids $this->doctrine->getManager()->flush(); - //Close curl handler - $this->curl_close(); - //Return success return self::SUCCESS; } @@ -653,9 +638,6 @@ class WeatherCommand extends DoctrineCommand { //Display error echo 'Setopt for '.$url.' failed: '.curl_error($this->ch)."\n"; - //Close curl handler - curl_close($this->ch); - //Exit with failure exit(self::FAILURE); } @@ -671,9 +653,6 @@ class WeatherCommand extends DoctrineCommand { //Display response var_dump($response); - //Close curl handler - curl_close($this->ch); - //Exit with failure exit(self::FAILURE); } @@ -689,9 +668,6 @@ class WeatherCommand extends DoctrineCommand { //Display response var_dump($response); - //Close curl handler - curl_close($this->ch); - //Exit with failure exit(self::FAILURE); } @@ -707,9 +683,6 @@ class WeatherCommand extends DoctrineCommand { //Display response var_dump($response); - //Close curl handler - curl_close($this->ch); - //Exit with failure exit(self::FAILURE); } @@ -725,9 +698,6 @@ class WeatherCommand extends DoctrineCommand { //Display response var_dump($header); - //Close curl handler - curl_close($this->ch); - //Exit with failure exit(self::FAILURE); } @@ -735,13 +705,4 @@ class WeatherCommand extends DoctrineCommand { //Return content return substr($response, $hs); } - - /** - * Close curl handler - * - * @return bool Return success or failure - */ - function curl_close() { - return curl_close($this->ch); - } }