Add @throws tags
This commit is contained in:
parent
2e71a04ee2
commit
1f9070a28f
1 changed files with 7 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ final class ReadingTimeExtension extends Minz_Extension {
|
||||||
private string $metrics = 'words';
|
private string $metrics = 'words';
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
|
/** @throws FreshRSS_Context_Exception */
|
||||||
public function init(): void {
|
public function init(): void {
|
||||||
$this->registerTranslates();
|
$this->registerTranslates();
|
||||||
if (!FreshRSS_Context::hasUserConf()) {
|
if (!FreshRSS_Context::hasUserConf()) {
|
||||||
|
|
@ -55,6 +56,10 @@ final class ReadingTimeExtension extends Minz_Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[\Override]
|
#[\Override]
|
||||||
|
/**
|
||||||
|
* @throws FreshRSS_Context_Exception
|
||||||
|
* @throws Minz_ActionException
|
||||||
|
*/
|
||||||
public function handleConfigureAction(): void {
|
public function handleConfigureAction(): void {
|
||||||
$this->registerTranslates();
|
$this->registerTranslates();
|
||||||
|
|
||||||
|
|
@ -65,6 +70,7 @@ final class ReadingTimeExtension extends Minz_Extension {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @throws Minz_ActionException */
|
||||||
private function validateSpeed(int $speed): int {
|
private function validateSpeed(int $speed): int {
|
||||||
if ($speed <= 0) {
|
if ($speed <= 0) {
|
||||||
throw new Minz_ActionException(_t('ext.reading_time.speed.invalid'), Minz_Request::actionName());
|
throw new Minz_ActionException(_t('ext.reading_time.speed.invalid'), Minz_Request::actionName());
|
||||||
|
|
@ -72,6 +78,7 @@ final class ReadingTimeExtension extends Minz_Extension {
|
||||||
return $speed;
|
return $speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @throws Minz_ActionException */
|
||||||
private function validateMetrics(string $metrics): string {
|
private function validateMetrics(string $metrics): string {
|
||||||
switch ($metrics) {
|
switch ($metrics) {
|
||||||
case 'words':
|
case 'words':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue