PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / includes / Core / Util / Translation / ProviderProbe.php

ProviderProbe.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.3.1, at includes/Core/Util/Translation/ProviderProbe.php

34 lines 901 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BitCode\BitForm\Core\Util\Translation;
4
5 /**
6 * Presence checks for the built-in providers, in one small file the manager can
7 * load instead of every provider class. Each provider's isAvailable() delegates
8 * here, so a rule has exactly one home.
9 *
10 * `::class` in the match arms is a compile-time string and does not autoload.
11 */
12 final class ProviderProbe
13 {
14 /**
15 * @param mixed $class
16 *
17 * @return bool|null null when $class is not a built-in provider
18 */
19 public static function isActive($class)
20 {
21 switch ($class) {
22 case Provider\WpmlProvider::class:
23 return defined('ICL_SITEPRESS_VERSION');
24
25 case Provider\PolylangProvider::class:
26 return function_exists('pll__');
27
28 case Provider\TranslatePressProvider::class:
29 return class_exists('TRP_Translate_Press') || function_exists('trp_translate');
30 }
31 return null;
32 }
33 }
34