Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
catalogue
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 all
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 get
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2// This file is part of Moodle - https://moodle.org/
3//
4// Moodle is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// Moodle is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with Moodle.  If not, see <https://www.gnu.org/licenses/>.
16
17namespace message_notifyhub\local;
18
19/**
20 * DevLMS channel plugins the hub can install: where each one's code lives on GitHub and what it reaches.
21 *
22 * Releases are not listed here: the newest release, its zip and its SHA-256 come from GitHub (see releases), so a
23 * new channel release reaches every site without a new hub release. Any other message output or SMS gateway
24 * installed on the site works in the hub too; this list is only what the hub can install for you.
25 *
26 * @package    message_notifyhub
27 * @copyright  2026 DevLMS
28 * @license    https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29 */
30final class catalogue {
31    /** @var array[]|null For tests: entries instead of the built-in ones. */
32    public static ?array $override = null;
33
34    /** @var array[] component => entry; kind is message (an output) or sms (a core SMS gateway). */
35    private const ENTRIES = [
36        'message_ntfy' => [
37            'kind' => 'message',
38            'regions' => 'Worldwide',
39            'repo' => 'devlms/moodle-message_ntfy',
40            'guide' => 'https://devlms.com/work/moodle-notifications-on-your-phone-with-ntfy/',
41        ],
42        'smsgateway_africastalking' => [
43            'kind' => 'sms',
44            'regions' => 'Kenya, Uganda, Tanzania, Rwanda, Nigeria, Malawi, Zambia, Ethiopia and more',
45            'repo' => 'devlms/moodle-smsgateway_africastalking',
46            'guide' => 'https://devlms.com/work/moodle-sms-africas-talking/',
47        ],
48    ];
49
50    /**
51     * Every entry.
52     *
53     * @return array[]
54     */
55    public static function all(): array {
56        return self::$override ?? self::ENTRIES;
57    }
58
59    /**
60     * One entry.
61     *
62     * @param string $component
63     * @return array|null
64     */
65    public static function get(string $component): ?array {
66        return self::all()[$component] ?? null;
67    }
68}