Ignore missingType.checkedException in phpstan
This commit is contained in:
parent
62d6ca7ef5
commit
683aa50d15
1 changed files with 10 additions and 13 deletions
|
|
@ -7,27 +7,26 @@ 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()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Defaults
|
// Defaults
|
||||||
$speed = FreshRSS_Context::userConf()->attributeInt('reading_time_speed');
|
$speed = FreshRSS_Context::userConf()->attributeInt('reading_time_speed'); // @phpstan-ignore missingType.checkedException
|
||||||
if ($speed === null) {
|
if ($speed === null) {
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $this->speed);
|
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $this->speed); // @phpstan-ignore missingType.checkedException
|
||||||
} else {
|
} else {
|
||||||
$this->speed = $speed;
|
$this->speed = $speed;
|
||||||
}
|
}
|
||||||
$metrics = FreshRSS_Context::userConf()->attributeString('reading_time_metrics');
|
$metrics = FreshRSS_Context::userConf()->attributeString('reading_time_metrics'); // @phpstan-ignore missingType.checkedException
|
||||||
if ($metrics === null) {
|
if ($metrics === null) {
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $this->metrics);
|
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $this->metrics); // @phpstan-ignore missingType.checkedException
|
||||||
} else {
|
} else {
|
||||||
$this->metrics = $metrics;
|
$this->metrics = $metrics;
|
||||||
}
|
}
|
||||||
if (in_array(null, [$speed, $metrics], true)) {
|
if (in_array(null, [$speed, $metrics], true)) {
|
||||||
FreshRSS_Context::userConf()->save();
|
FreshRSS_Context::userConf()->save(); // @phpstan-ignore missingType.checkedException
|
||||||
}
|
}
|
||||||
$this->registerHook('js_vars', [$this, 'getParams']);
|
$this->registerHook('js_vars', [$this, 'getParams']);
|
||||||
Minz_View::appendScript($this->getFileUrl('readingtime.js', 'js'));
|
Minz_View::appendScript($this->getFileUrl('readingtime.js', 'js'));
|
||||||
|
|
@ -56,17 +55,15 @@ 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();
|
||||||
|
|
||||||
if (Minz_Request::isPost()) {
|
if (Minz_Request::isPost()) {
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $this->validateSpeed(Minz_Request::paramInt('reading_time_speed')));
|
$speed = $this->validateSpeed(Minz_Request::paramInt('reading_time_speed')); // @phpstan-ignore missingType.checkedException
|
||||||
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $this->validateMetrics(Minz_Request::paramString('reading_time_metrics')));
|
FreshRSS_Context::userConf()->_attribute('reading_time_speed', $speed); // @phpstan-ignore missingType.checkedException
|
||||||
FreshRSS_Context::userConf()->save();
|
$metrics = $this->validateMetrics(Minz_Request::paramString('reading_time_metrics')); // @phpstan-ignore missingType.checkedException
|
||||||
|
FreshRSS_Context::userConf()->_attribute('reading_time_metrics', $metrics); // @phpstan-ignore missingType.checkedException
|
||||||
|
FreshRSS_Context::userConf()->save(); // @phpstan-ignore missingType.checkedException
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue