Skip to content

Commit

Permalink
update get to has
Browse files Browse the repository at this point in the history
  • Loading branch information
easydowork authored Feb 11, 2024
1 parent 2ecfff3 commit 29567a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/base/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ public function createController($route)
*/
public function createControllerByID($id)
{
if(Yii::$app->get('cache')){
if(Yii::$app->has('cache')){
$cacheKey = [Yii::$app->id,Yii::getAlias('@app'),__FUNCTION__,$id];
$className = Yii::$app->cache->get($cacheKey);

Check warning on line 646 in framework/base/Module.php

View check run for this annotation

Codecov / codecov/patch

framework/base/Module.php#L645-L646

Added lines #L645 - L646 were not covered by tests
}
Expand Down Expand Up @@ -670,7 +670,7 @@ public function createControllerByID($id)
if (!is_subclass_of($className, 'yii\base\Controller')) {
$className = '';

Check warning on line 671 in framework/base/Module.php

View check run for this annotation

Codecov / codecov/patch

framework/base/Module.php#L671

Added line #L671 was not covered by tests
}else{
if(Yii::$app->get('cache')) {
if(Yii::$app->has('cache')) {
Yii::$app->cache->set($cacheKey, $className);

Check warning on line 674 in framework/base/Module.php

View check run for this annotation

Codecov / codecov/patch

framework/base/Module.php#L674

Added line #L674 was not covered by tests
}
}
Expand Down

0 comments on commit 29567a9

Please sign in to comment.