Fix #20532: Add missing return statements in CacheController::actionFlushSchema, FixtureController::actionUnload, HelpController::actionIndex and ServeController::actionIndex

This commit is contained in:
Maksim Spirkov
2025-09-30 02:17:34 +04:00
committed by GitHub
parent 848cd97849
commit dba9e4d76d
8 changed files with 15 additions and 50 deletions

View File

@ -10,6 +10,7 @@ namespace yii\build\controllers;
use Yii; use Yii;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
use yii\console\Controller; use yii\console\Controller;
use yii\console\ExitCode;
use yii\helpers\Console; use yii\helpers\Console;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
@ -316,6 +317,8 @@ class DevController extends Controller
symlink("$base/extensions/$ext", $link); symlink("$base/extensions/$ext", $link);
} }
} }
return ExitCode::OK;
} }
/** /**

View File

@ -3,6 +3,7 @@ Yii Framework 2 Change Log
2.0.54 under development 2.0.54 under development
------------------------ ------------------------
- Bug #20483: Fix `CompositeAuth` making bad assumptions on `AuthInterface` implementations (sammousa) - Bug #20483: Fix `CompositeAuth` making bad assumptions on `AuthInterface` implementations (sammousa)
- Bug #20432: Fix PHPStan/Psalm annotations for `ActiveQuery::asArray` (max-s-lab) - Bug #20432: Fix PHPStan/Psalm annotations for `ActiveQuery::asArray` (max-s-lab)
- Bug #20437: Fix PHPStan/Psalm annotations for `BaseArrayHelper::merge` (max-s-lab) - Bug #20437: Fix PHPStan/Psalm annotations for `BaseArrayHelper::merge` (max-s-lab)
@ -32,6 +33,7 @@ Yii Framework 2 Change Log
- Enh #20525: Add `@template` annotations for all actions (max-s-lab) - Enh #20525: Add `@template` annotations for all actions (max-s-lab)
- Bug #20524: Fix PHPStan/Psalm annotations in `Yii::createObject` (max-s-lab) - Bug #20524: Fix PHPStan/Psalm annotations in `Yii::createObject` (max-s-lab)
- Bug #20530: Fix notice "Object of class DateTimeImmutable could not be converted to int" in `CookieCollection::has` (max-s-lab) - Bug #20530: Fix notice "Object of class DateTimeImmutable could not be converted to int" in `CookieCollection::has` (max-s-lab)
- Bug #20532: Add missing `return` statements in `CacheController::actionFlushSchema`, `FixtureController::actionUnload`, `HelpController::actionIndex` and `ServeController::actionIndex` (max-s-lab)
- Bug #19655: Fix `LinkPager::getPageRange` when `maxButtons` is 2 (max-s-lab) - Bug #19655: Fix `LinkPager::getPageRange` when `maxButtons` is 2 (max-s-lab)
- Enh #20539: Update minimum PHP version requirement from `7.3` to `7.4` (terabytesoftw) - Enh #20539: Update minimum PHP version requirement from `7.3` to `7.4` (terabytesoftw)
- Bug #20541: Remove deprecated caching components: `XCache` and `ZendDataCache`, and update related tests and documentation (terabytesoftw) - Bug #20541: Remove deprecated caching components: `XCache` and `ZendDataCache`, and update related tests and documentation (terabytesoftw)

View File

@ -169,6 +169,8 @@ class CacheController extends Controller
} catch (\Exception $e) { } catch (\Exception $e) {
$this->stdout($e->getMessage() . "\n\n", Console::FG_RED); $this->stdout($e->getMessage() . "\n\n", Console::FG_RED);
} }
return ExitCode::OK;
} }
/** /**

View File

@ -232,6 +232,8 @@ class FixtureController extends Controller
$this->unloadFixtures($this->createFixtures($fixtures)); $this->unloadFixtures($this->createFixtures($fixtures));
$this->notifyUnloaded($fixtures); $this->notifyUnloaded($fixtures);
return ExitCode::OK;
} }
/** /**

View File

@ -11,6 +11,7 @@ use Yii;
use yii\base\Application; use yii\base\Application;
use yii\console\Controller; use yii\console\Controller;
use yii\console\Exception; use yii\console\Exception;
use yii\console\ExitCode;
use yii\helpers\Console; use yii\helpers\Console;
use yii\helpers\Inflector; use yii\helpers\Inflector;
@ -66,6 +67,8 @@ class HelpController extends Controller
} else { } else {
$this->getDefaultHelp(); $this->getDefaultHelp();
} }
return ExitCode::OK;
} }
/** /**

View File

@ -9,6 +9,7 @@ namespace yii\console\controllers;
use Yii; use Yii;
use yii\console\Controller; use yii\console\Controller;
use yii\console\ExitCode;
use yii\helpers\Console; use yii\helpers\Console;
/** /**
@ -87,6 +88,8 @@ class ServeController extends Controller
} }
$this->runCommand($command); $this->runCommand($command);
return ExitCode::OK;
} }
/** /**

View File

@ -1,35 +1,10 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: "#^Method yii\\\\build\\\\controllers\\\\DevController\\:\\:linkFrameworkAndExtensions\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: build/controllers/DevController.php
- -
message: "#^Class BackedEnum not found\\.$#" message: "#^Class BackedEnum not found\\.$#"
count: 1 count: 1
path: framework/behaviors/AttributeTypecastBehavior.php path: framework/behaviors/AttributeTypecastBehavior.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\CacheController\\:\\:actionFlushSchema\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/CacheController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\FixtureController\\:\\:actionUnload\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/FixtureController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\HelpController\\:\\:actionIndex\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/HelpController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\ServeController\\:\\:actionIndex\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/ServeController.php
- -
message: "#^Variable \\$viaClass might not be defined\\.$#" message: "#^Variable \\$viaClass might not be defined\\.$#"
count: 5 count: 5

View File

@ -1,30 +1,5 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
-
message: "#^Method yii\\\\build\\\\controllers\\\\DevController\\:\\:linkFrameworkAndExtensions\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: build/controllers/DevController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\CacheController\\:\\:actionFlushSchema\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/CacheController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\FixtureController\\:\\:actionUnload\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/FixtureController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\HelpController\\:\\:actionIndex\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/HelpController.php
-
message: "#^Method yii\\\\console\\\\controllers\\\\ServeController\\:\\:actionIndex\\(\\) should return int but return statement is missing\\.$#"
count: 1
path: framework/console/controllers/ServeController.php
- -
message: "#^Variable \\$viaClass might not be defined\\.$#" message: "#^Variable \\$viaClass might not be defined\\.$#"
count: 5 count: 5