Skip to content

Commit

Permalink
Merge pull request #19962 from terabytesoftw/remove-deprecated-contro…
Browse files Browse the repository at this point in the history
…ller

Remove deprecated constant to `Controller::class`.
  • Loading branch information
bizley authored Sep 22, 2023
2 parents b0cc791 + f7a9fa5 commit d2c397d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
9 changes: 0 additions & 9 deletions framework/console/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@
*/
class Controller extends \yii\base\Controller
{
/**
* @deprecated since 2.0.13. Use [[ExitCode::OK]] instead.
*/
const EXIT_CODE_NORMAL = 0;
/**
* @deprecated since 2.0.13. Use [[ExitCode::UNSPECIFIED_ERROR]] instead.
*/
const EXIT_CODE_ERROR = 1;

/**
* @var bool whether to run the command interactively.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace yiiunit\framework\console\controllers;

use Yii;
use yii\console\ExitCode;
use yii\db\Connection;

/**
Expand Down Expand Up @@ -44,7 +45,7 @@ protected static function runConsoleAction($route, $params = [])
ob_start();
$result = Yii::$app->runAction($route, $params);
echo 'Result is ' . $result;
if ($result !== \yii\console\Controller::EXIT_CODE_NORMAL) {
if ($result !== ExitCode::OK) {
ob_end_flush();
} else {
ob_end_clean();
Expand Down
3 changes: 2 additions & 1 deletion tests/framework/i18n/DbMessageSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Yii;
use yii\base\Event;
use yii\console\ExitCode;
use yii\db\Connection;
use yii\i18n\DbMessageSource;
use yii\i18n\I18N;
Expand Down Expand Up @@ -66,7 +67,7 @@ protected static function runConsoleAction($route, $params = [])
ob_start();
$result = Yii::$app->runAction($route, $params);
echo 'Result is ' . $result;
if ($result !== \yii\console\Controller::EXIT_CODE_NORMAL) {
if ($result !== ExitCode::OK) {
ob_end_flush();
} else {
ob_end_clean();
Expand Down
3 changes: 2 additions & 1 deletion tests/framework/log/DbTargetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace yiiunit\framework\log;

use Yii;
use yii\console\ExitCode;
use yii\db\Connection;
use yii\db\Query;
use yii\log\Logger;
Expand Down Expand Up @@ -57,7 +58,7 @@ protected static function runConsoleAction($route, $params = [])
ob_start();
$result = Yii::$app->runAction($route, $params);
echo 'Result is ' . $result;
if ($result !== \yii\console\Controller::EXIT_CODE_NORMAL) {
if ($result !== ExitCode::OK) {
ob_end_flush();
} else {
ob_end_clean();
Expand Down

0 comments on commit d2c397d

Please sign in to comment.