Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
16.67% covered (danger)
16.67%
1 / 6
33.33% covered (danger)
33.33%
1 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
Application
16.67% covered (danger)
16.67%
1 / 6
33.33% covered (danger)
33.33%
1 / 3
8.21
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 register
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 boot
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * Nextcloud - cospend
4 *
5 * This file is licensed under the Affero General Public License version 3 or
6 * later. See the COPYING file.
7 *
8 * @author Julien Veyssier <eneiluj@posteo.net>
9 * @copyright Julien Veyssier 2018
10 */
11
12namespace OCA\Cospend\AppInfo;
13
14use OCA\Cospend\UserMigration\UserMigrator;
15use OCP\AppFramework\App;
16use OCP\AppFramework\Bootstrap\IRegistrationContext;
17use OCP\AppFramework\Bootstrap\IBootContext;
18use OCP\AppFramework\Bootstrap\IBootstrap;
19
20use OCA\Cospend\Search\CospendSearchProvider;
21use OCA\Cospend\Dashboard\CospendWidget;
22use OCA\Cospend\Notification\Notifier;
23use OCP\Util;
24
25/**
26 * Class Application
27 *
28 * @package OCA\Cospend\AppInfo
29 */
30class Application extends App implements IBootstrap {
31
32    public const APP_ID = 'cospend';
33
34    public const CAT_REIMBURSEMENT = -11;
35
36    public const SORT_ORDERS = [
37        'alpha' => 'a',
38        'manual' => 'm',
39        'most_used' => 'u',
40        'most_recently_used' => 'r',
41    ];
42
43    public const FREQUENCIES = [
44        'no' => 'n',
45        'daily' => 'd',
46        'weekly' => 'w',
47        'bi_weekly' => 'b',
48        'semi_monthly' => 's',
49        'monthly' => 'm',
50        'yearly' => 'y',
51    ];
52
53    public const ACCESS_LEVELS = [
54        'none' => 0,
55        'viewer' => 1,
56        'participant' => 2,
57        'maintainer' => 3,
58        'admin' => 4,
59    ];
60
61    public const SHARE_TYPES = [
62        'public_link' => 'l',
63        'user' => 'u',
64        'group' => 'g',
65        'circle' => 'c',
66    ];
67
68    public const HARDCODED_CATEGORIES = [
69        -11 => [
70            'icon' => '💰',
71        ],
72    ];
73
74    /**
75     * Constructor
76     *
77     * @param array $urlParams
78     */
79    public function __construct(array $urlParams = []) {
80        parent::__construct(self::APP_ID, $urlParams);
81    }
82
83    public function register(IRegistrationContext $context): void {
84        $context->registerNotifierService(Notifier::class);
85        $context->registerSearchProvider(CospendSearchProvider::class);
86        $context->registerDashboardWidget(CospendWidget::class);
87        $context->registerUserMigrator(UserMigrator::class);
88    }
89
90    public function boot(IBootContext $context): void {
91        Util::addStyle(self::APP_ID, 'cospend-search');
92    }
93}
94