diff --git a/build/controllers/DevController.php b/build/controllers/DevController.php index 499b43766a..0e87f2275f 100644 --- a/build/controllers/DevController.php +++ b/build/controllers/DevController.php @@ -10,6 +10,7 @@ namespace yii\build\controllers; use Yii; use yii\base\InvalidParamException; use yii\console\Controller; +use yii\console\ExitCode; use yii\helpers\Console; use yii\helpers\FileHelper; @@ -316,6 +317,8 @@ class DevController extends Controller symlink("$base/extensions/$ext", $link); } } + + return ExitCode::OK; } /** diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 3c60f0f811..48335039e9 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -3,6 +3,7 @@ Yii Framework 2 Change Log 2.0.54 under development ------------------------ + - Bug #20483: Fix `CompositeAuth` making bad assumptions on `AuthInterface` implementations (sammousa) - Bug #20432: Fix PHPStan/Psalm annotations for `ActiveQuery::asArray` (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) - 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 #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) - 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) diff --git a/framework/console/controllers/CacheController.php b/framework/console/controllers/CacheController.php index d5d0a756e4..3dd374572e 100644 --- a/framework/console/controllers/CacheController.php +++ b/framework/console/controllers/CacheController.php @@ -169,6 +169,8 @@ class CacheController extends Controller } catch (\Exception $e) { $this->stdout($e->getMessage() . "\n\n", Console::FG_RED); } + + return ExitCode::OK; } /** diff --git a/framework/console/controllers/FixtureController.php b/framework/console/controllers/FixtureController.php index caad8232ff..c9f27e1861 100644 --- a/framework/console/controllers/FixtureController.php +++ b/framework/console/controllers/FixtureController.php @@ -232,6 +232,8 @@ class FixtureController extends Controller $this->unloadFixtures($this->createFixtures($fixtures)); $this->notifyUnloaded($fixtures); + + return ExitCode::OK; } /** diff --git a/framework/console/controllers/HelpController.php b/framework/console/controllers/HelpController.php index 074657f45a..d243df02e3 100644 --- a/framework/console/controllers/HelpController.php +++ b/framework/console/controllers/HelpController.php @@ -11,6 +11,7 @@ use Yii; use yii\base\Application; use yii\console\Controller; use yii\console\Exception; +use yii\console\ExitCode; use yii\helpers\Console; use yii\helpers\Inflector; @@ -66,6 +67,8 @@ class HelpController extends Controller } else { $this->getDefaultHelp(); } + + return ExitCode::OK; } /** diff --git a/framework/console/controllers/ServeController.php b/framework/console/controllers/ServeController.php index af812984b7..c83c5cc1a7 100644 --- a/framework/console/controllers/ServeController.php +++ b/framework/console/controllers/ServeController.php @@ -9,6 +9,7 @@ namespace yii\console\controllers; use Yii; use yii\console\Controller; +use yii\console\ExitCode; use yii\helpers\Console; /** @@ -87,6 +88,8 @@ class ServeController extends Controller } $this->runCommand($command); + + return ExitCode::OK; } /** diff --git a/phpstan-baseline-7x.neon b/phpstan-baseline-7x.neon index 612a53bf9a..a79f76635d 100644 --- a/phpstan-baseline-7x.neon +++ b/phpstan-baseline-7x.neon @@ -1,35 +1,10 @@ parameters: 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\\.$#" count: 1 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\\.$#" count: 5 diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b954ad65f4..fc0a1fdd74 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,30 +1,5 @@ parameters: 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\\.$#" count: 5