getConstants(); $reader = Reader::createFromDefaults(); foreach ($constants as $constName => $value) { $annotations = $reader->getConstantAnnotations(static::class, $constName); $isInternal = $annotations->get('internal', false); $keyValue = [ 'value' => $value, ]; if ($isInternal) { $keyValue['internal'] = true; } $scopes[$constName] = $keyValue; } Yii::$app->cache->set($cacheKey, $scopes, 3600); } return $scopes; } }