Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-04-08 18:15:48 +0300
committerJoas Schilling <coding@schilljs.com>2022-04-08 18:15:48 +0300
commit410d2e4615e95360da9a8fefc8bbec1c68dc4668 (patch)
tree1a590349b448c589b612550ce9fbf324df3935e9 /lib
parentfa7b69dc9f4f570abbacfb526f62ac5a3a6cb258 (diff)
Fix remaining psalm complains
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Categories/Apps.php4
-rw-r--r--lib/Categories/Database.php12
-rw-r--r--lib/Collector.php13
-rw-r--r--lib/Settings/AdminSettings.php11
4 files changed, 9 insertions, 31 deletions
diff --git a/lib/Categories/Apps.php b/lib/Categories/Apps.php
index 1d2e051..b5bec44 100644
--- a/lib/Categories/Apps.php
+++ b/lib/Categories/Apps.php
@@ -21,7 +21,7 @@
namespace OCA\Survey_Client\Categories;
-use Doctrine\DBAL\Connection;
+use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IL10N;
@@ -70,7 +70,7 @@ class Apps implements ICategory {
->from('appconfig')
->where($query->expr()->in('configkey', $query->createNamedParameter(
['enabled', 'installed_version'],
- Connection::PARAM_STR_ARRAY
+ IQueryBuilder::PARAM_STR_ARRAY
)));
$result = $query->execute();
diff --git a/lib/Categories/Database.php b/lib/Categories/Database.php
index 2e55aed..30846d1 100644
--- a/lib/Categories/Database.php
+++ b/lib/Categories/Database.php
@@ -31,20 +31,15 @@ use OCP\IL10N;
* @package OCA\Survey_Client\Categories
*/
class Database implements ICategory {
- /** @var \OCP\IConfig */
+ /** @var IConfig */
protected $config;
- /** @var \OCP\IDBConnection */
+ /** @var IDBConnection */
protected $connection;
- /** @var \OCP\IL10N */
+ /** @var IL10N */
protected $l;
- /**
- * @param IConfig $config
- * @param IDBConnection $connection
- * @param IL10N $l
- */
public function __construct(IConfig $config, IDBConnection $connection, IL10N $l) {
$this->config = $config;
$this->connection = $connection;
@@ -137,6 +132,7 @@ class Database implements ICategory {
if (file_exists($this->config->getSystemValue('dbhost'))) {
$database_size = filesize($this->config->getSystemValue('dbhost'));
} else {
+ /** @psalm-suppress UndefinedInterfaceMethod */
$params = $this->connection->getParams();
if (file_exists($params['path'])) {
$database_size = filesize($params['path']);
diff --git a/lib/Collector.php b/lib/Collector.php
index 54c0bff..75f3e37 100644
--- a/lib/Collector.php
+++ b/lib/Collector.php
@@ -55,18 +55,9 @@ class Collector {
/** @var IniGetWrapper */
protected $phpIni;
- /** @var \OCP\IL10N */
+ /** @var IL10N */
protected $l;
- /**
- * Collector constructor.
- *
- * @param IClientService $clientService
- * @param IConfig $config
- * @param IDBConnection $connection
- * @param IniGetWrapper $phpIni
- * @param IL10N $l
- */
public function __construct(IClientService $clientService, IConfig $config, IDBConnection $connection, IniGetWrapper $phpIni, IL10N $l) {
$this->clientService = $clientService;
$this->config = $config;
@@ -173,7 +164,7 @@ class Collector {
}
if ($response->getStatusCode() === Http::STATUS_OK) {
- $this->config->setAppValue('survey_client', 'last_sent', time());
+ $this->config->setAppValue('survey_client', 'last_sent', (string) time());
$this->config->setAppValue('survey_client', 'last_report', json_encode($report));
return new DataResponse(
$report
diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php
index d52ad12..b17f4fb 100644
--- a/lib/Settings/AdminSettings.php
+++ b/lib/Settings/AdminSettings.php
@@ -47,15 +47,6 @@ class AdminSettings implements ISettings {
/** @var IJobList */
private $jobList;
- /**
- * Admin constructor.
- *
- * @param Collector $collector
- * @param IConfig $config
- * @param IL10N $l
- * @param IDateTimeFormatter $dateTimeFormatter
- * @param IJobList $jobList
- */
public function __construct(Collector $collector,
IConfig $config,
IL10N $l,
@@ -73,7 +64,7 @@ class AdminSettings implements ISettings {
* @return TemplateResponse
*/
public function getForm() {
- $lastSentReportTime = (int) $this->config->getAppValue('survey_client', 'last_sent', 0);
+ $lastSentReportTime = (int) $this->config->getAppValue('survey_client', 'last_sent', '0');
if ($lastSentReportTime === 0) {
$lastSentReportDate = $this->l->t('Never');
} else {