@ -1116,7 +1118,6 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
return $values;
return $values;
}
}
}
/**
/**
* Populates an active record object using a row of data from the database/storage.
* Populates an active record object using a row of data from the database/storage.
@ -1193,16 +1194,16 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
} catch (UnknownMethodException $e) {
} catch (UnknownMethodException $e) {
if ($throwException) {
if ($throwException) {
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e);
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e);
} else {
return null;
}
}
return null;
}
}
if (!$relation instanceof ActiveQueryInterface) {
if (!$relation instanceof ActiveQueryInterface) {
if ($throwException) {
if ($throwException) {
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".');
throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".');
} else {
return null;
}
}
return null;
}
}
if (method_exists($this, $getter)) {
if (method_exists($this, $getter)) {
@ -1212,9 +1213,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
if ($realName !== $name) {
if ($realName !== $name) {
if ($throwException) {
if ($throwException) {
throw new InvalidParamException('Relation names are case sensitive. ' . get_class($this) . " has a relation named \"$realName\" instead of \"$name\".");
throw new InvalidParamException('Relation names are case sensitive. ' . get_class($this) . " has a relation named \"$realName\" instead of \"$name\".");
} else {
return null;
}
}
return null;
}
}
}
}
@ -1538,9 +1539,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
@ -1056,14 +1063,15 @@ class Formatter extends Component
if (($result = $f->format($value)) === false) {
if (($result = $f->format($value)) === false) {
throw new InvalidParamException('Formatting scientific number value failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
throw new InvalidParamException('Formatting scientific number value failed: ' . $f->getErrorCode() . ' ' . $f->getErrorMessage());
}
}
return $result;
return $result;
} else {
}
if ($decimals !== null) {
if ($decimals !== null) {
return sprintf("%.{$decimals}E", $value);
return sprintf("%.{$decimals}E", $value);
} else {
return sprintf('%.E', $value);
}
}
}
return sprintf('%.E', $value);
}
}
/**
/**
@ -1104,17 +1112,19 @@ class Formatter extends Component
if ($result === false) {
if ($result === false) {
throw new InvalidParamException('Formatting currency value failed: ' . $formatter->getErrorCode() . ' ' . $formatter->getErrorMessage());
throw new InvalidParamException('Formatting currency value failed: ' . $formatter->getErrorCode() . ' ' . $formatter->getErrorMessage());
}
}
return $result;
return $result;
} else {
}
if ($currency === null) {
if ($currency === null) {
if ($this->currencyCode === null) {
if ($this->currencyCode === null) {
throw new InvalidConfigException('The default currency code for the formatter is not defined and the php intl extension is not installed which could take the default currency from the locale.');
throw new InvalidConfigException('The default currency code for the formatter is not defined and the php intl extension is not installed which could take the default currency from the locale.');
@ -87,12 +87,12 @@ class ViewAction extends Action
if (YII_DEBUG) {
if (YII_DEBUG) {
throw new NotFoundHttpException($e->getMessage());
throw new NotFoundHttpException($e->getMessage());
} else {
}
throw new NotFoundHttpException(
throw new NotFoundHttpException(
Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName])
Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName])
);
);
}
}
}
return $output;
return $output;
}
}
@ -121,9 +121,9 @@ class ViewAction extends Action
if (!is_string($viewName) || !preg_match('~^\w(?:(?!\/\.{0,2}\/)[\w\/\-\.])*$~', $viewName)) {
if (!is_string($viewName) || !preg_match('~^\w(?:(?!\/\.{0,2}\/)[\w\/\-\.])*$~', $viewName)) {
if (YII_DEBUG) {
if (YII_DEBUG) {
throw new NotFoundHttpException("The requested view \"$viewName\" must start with a word character, must not contain /../ or /./, can contain only word characters, forward slashes, dots and dashes.");
throw new NotFoundHttpException("The requested view \"$viewName\" must start with a word character, must not contain /../ or /./, can contain only word characters, forward slashes, dots and dashes.");
} else {
throw new NotFoundHttpException(Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName]));
}
}
throw new NotFoundHttpException(Yii::t('yii', 'The requested view "{name}" was not found.', ['name' => $viewName]));