Issues (496)

lib/Migration/Version4009Date20230517190000.php (5 issues)

Labels
Severity
1
<?php
2
/**
3
 * Analytics
4
 *
5
 * SPDX-FileCopyrightText: 2019-2022 Marcel Scherello
6
 * SPDX-License-Identifier: AGPL-3.0-or-later
7
 */
8
9
declare(strict_types=1);
10
11
namespace OCA\Analytics\Migration;
12
13
use Closure;
14
use OCP\DB\Exception;
0 ignored issues
show
The type OCP\DB\Exception was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use OCP\DB\ISchemaWrapper;
0 ignored issues
show
The type OCP\DB\ISchemaWrapper was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use OCP\IDBConnection;
0 ignored issues
show
The type OCP\IDBConnection was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use OCP\Migration\IOutput;
0 ignored issues
show
The type OCP\Migration\IOutput was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use OCP\Migration\SimpleMigrationStep;
0 ignored issues
show
The type OCP\Migration\SimpleMigrationStep was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
20
/**
21
 * Auto-generated migration step: Please modify to your needs!
22
 * sudo -u www-data php /var/www/nextcloud/occ migrations:execute analytics 4009Date20230517190000
23
 */
24
class Version4009Date20230517190000 extends SimpleMigrationStep
25
{
26
27
    /** @var IDBConnection */
28
    private $connection;
29
30
    public function __construct(IDBConnection $connection)
31
    {
32
        $this->connection = $connection;
33
    }
34
35
    /**
36
     * @param IOutput $output
37
     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
38
     * @param array $options
39
     * @throws Exception
40
     */
41
    public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
42
    {
43
        $query = $this->connection->getQueryBuilder();
44
        $query->insert('analytics_whats_new')
45
            ->values([
46
                'version' => $query->createNamedParameter('4.9.1'),
47
                'data' => $query->createNamedParameter('{"changelogURL":"https:\/\/github.com\/rello\/analytics\/blob\/master\/CHANGELOG.md","whatsNew":{
48
"en":{"regular":["Column picker for data sources","Sharing of report groups","Smart picker integration"],"admin":["New Features apply to users"]},
49
"de":{"regular":["Spaltenauswahl für Datenquellen","Teilen von Berichtsgruppen","Smart Picker Integration"],"admin":["Nur User Features"]}
50
}}'),
51
            ])
52
            ->executeStatement();
53
    }
54
}