• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

LibreSign / libresign / 3717593689

pending completion
3717593689

Pull #1287

github

GitHub
Merge 42fe701e4 into ff8c1edaf
Pull Request #1287: [stable25] Bump packages

2548 of 4384 relevant lines covered (58.12%)

4.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lib/Files/TemplateLoader.php
1
<?php
2
/*
3
 * @copyright Copyright (c) 2022 Vitor Mattos <vitor@php.rio>
4
 *
5
 * @author Vitor Mattos <vitor@php.rio>
6
 *
7
 * @license GNU AGPL version 3 or any later version
8
 *
9
 * This program is free software: you can redistribute it and/or modify
10
 * it under the terms of the GNU Affero General Public License as
11
 * published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU Affero General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Affero General Public License
20
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22

23
namespace OCA\Libresign\Files;
24

25
use OCA\Files\Event\LoadSidebar;
26
use OCA\Libresign\Service\SignatureService;
27
use OCP\AppFramework\Services\IInitialState;
28
use OCP\EventDispatcher\Event;
29
use OCP\EventDispatcher\IEventDispatcher;
30
use OCP\EventDispatcher\IEventListener;
31

32
class TemplateLoader implements IEventListener {
33
        /** @var IInitialState */
34
        private $initialState;
35
        /** @var SignatureService */
36
        private $signatureService;
37

38
        public function __construct(
39
                IInitialState $initialState,
40
                SignatureService $signatureService
41
        ) {
42
                $this->initialState = $initialState;
×
43
                $this->signatureService = $signatureService;
×
44
        }
45

46
        public static function register(IEventDispatcher $dispatcher): void {
47
                $dispatcher->addServiceListener(LoadSidebar::class, self::class);
×
48
        }
49

50
        public function handle(Event $event): void {
51
                if (!($event instanceof LoadSidebar)) {
×
52
                        return;
×
53
                }
54
                $this->initialState->provideInitialState(
×
55
                        'certificate_ok',
×
56
                        $this->signatureService->hasRootCert()
×
57
                );
×
58
        }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc