Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| Filter | |
0.00% |
0 / 10 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getIdentifier | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPriority | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getIcon | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| filterTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| allowedApps | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | /** |
| 5 | * SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors |
| 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
| 7 | */ |
| 8 | |
| 9 | namespace OCA\Libresign\Activity; |
| 10 | |
| 11 | use OCA\Libresign\AppInfo\Application; |
| 12 | use OCA\Libresign\Events\SendSignNotificationEvent; |
| 13 | use OCA\Libresign\Events\SignedEvent; |
| 14 | use OCP\Activity\IFilter; |
| 15 | use OCP\IL10N; |
| 16 | use OCP\IURLGenerator; |
| 17 | |
| 18 | class Filter implements IFilter { |
| 19 | private const array ALLOWED_TYPES = [ |
| 20 | SendSignNotificationEvent::FILE_TO_SIGN, |
| 21 | SignedEvent::FILE_SIGNED, |
| 22 | ]; |
| 23 | public function __construct( |
| 24 | protected IL10N $l, |
| 25 | protected IURLGenerator $url, |
| 26 | ) { |
| 27 | $this->l = $l; |
| 28 | $this->url = $url; |
| 29 | } |
| 30 | |
| 31 | #[\Override] |
| 32 | public function getIdentifier() { |
| 33 | return Application::APP_ID; |
| 34 | } |
| 35 | |
| 36 | #[\Override] |
| 37 | public function getName() { |
| 38 | return 'LibreSign'; |
| 39 | } |
| 40 | |
| 41 | #[\Override] |
| 42 | public function getPriority() { |
| 43 | return 31; |
| 44 | } |
| 45 | |
| 46 | #[\Override] |
| 47 | public function getIcon() { |
| 48 | return $this->url->getAbsoluteURL($this->url->imagePath('libresign', 'app-dark.svg')); |
| 49 | } |
| 50 | |
| 51 | #[\Override] |
| 52 | public function filterTypes(array $types) { |
| 53 | return array_intersect(self::ALLOWED_TYPES, $types); |
| 54 | } |
| 55 | |
| 56 | #[\Override] |
| 57 | public function allowedApps() { |
| 58 | return [ |
| 59 | Application::APP_ID, |
| 60 | ]; |
| 61 | } |
| 62 | } |