PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.1.0
GiveWP – Donation Plugin and Fundraising Platform v4.1.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / TestData / Addons.php
Addons.php
68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\TestData;
4
5 use Give\TestData\Addons\CurrencySwitcher\ServiceProvider as CurrencySwitcher;
6 use Give\TestData\Addons\FeeRecovery\ServiceProvider as FeeRecovery;
7 use Give\TestData\Addons\Funds\ServiceProvider as Funds;
8 use Give\TestData\Addons\ManualDonations\ServiceProvider as ManualDonations;
9 use Give\TestData\Addons\RecurringDonations\ServiceProvider as RecurringDonations;
10
11 /**
12 * Class Addons
13 * @package Give\TestData\Helpers
14 */
15 class Addons
16 {
17 /**
18 * Get add-ons
19 *
20 * @since 1.0.0
21 * @return array[]
22 */
23 public static function getAddons()
24 {
25 return [
26 [
27 'isActive' => defined('GIVE_FUNDS_VERSION'),
28 'serviceProvider' => Funds::class,
29 ],
30 [
31 'isActive' => defined('GIVE_CURRENCY_SWITCHER_VERSION'),
32 'serviceProvider' => CurrencySwitcher::class,
33 ],
34 [
35 'isActive' => defined('GIVE_RECURRING_VERSION'),
36 'serviceProvider' => RecurringDonations::class,
37 ],
38 [
39 'isActive' => defined('GIVE_FEE_RECOVERY_VERSION'),
40 'serviceProvider' => FeeRecovery::class,
41 ],
42 [
43 'isActive' => defined('GIVE_MD_VERSION'),
44 'serviceProvider' => ManualDonations::class,
45 ],
46 [
47 'isActive' => defined('GIVE_FUNDS_ADDON_VERSION'),
48 'serviceProvider' => Funds::class,
49 ],
50 ];
51 }
52
53 /**
54 * Get active add-ons
55 * @since 1.0.0
56 * @return array[]
57 */
58 public static function getActiveAddons()
59 {
60 return array_filter(
61 self::getAddons(),
62 function ($addon) {
63 return $addon['isActive'];
64 }
65 );
66 }
67 }
68