PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 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 All 256 releases
give / vendor / vendor-prefixed / stellarwp / field-conditions / src / Config.php

Config.php in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at vendor/vendor-prefixed/stellarwp/field-conditions/src/Config.php

57 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Give\Vendors\StellarWP\FieldConditions;
6
7 use InvalidArgumentException;
8
9 /**
10 * Sets up the Field Condition library. It currently only provides an optional means of replacing an exception.
11 *
12 * @since 1.0.0
13 */
14 class Config
15 {
16 /**
17 * @var class-string<InvalidArgumentException>
18 */
19 private static $invalidArgumentExceptionClass = InvalidArgumentException::class;
20
21 /**
22 * @since 1.0.0
23 *
24 * @throws InvalidArgumentException
25 */
26 public static function throwInvalidArgumentException()
27 {
28 throw new self::$invalidArgumentExceptionClass(...func_get_args());
29 }
30
31 /**
32 * @since 1.0.0
33 *
34 * @return class-string<InvalidArgumentException>
35 */
36 public static function getInvalidArgumentExceptionClass(): string
37 {
38 return self::$invalidArgumentExceptionClass;
39 }
40
41 /**
42 * @since 1.0.0
43 *
44 * @param class-string<InvalidArgumentException> $invalidArgumentExceptionClass
45 */
46 public static function setInvalidArgumentExceptionClass(string $invalidArgumentExceptionClass)
47 {
48 if (!is_a($invalidArgumentExceptionClass, InvalidArgumentException::class, true)) {
49 throw new RuntimeException(
50 'The invalid argument exception class must extend the InvalidArgumentException'
51 );
52 }
53
54 self::$invalidArgumentExceptionClass = $invalidArgumentExceptionClass;
55 }
56 }
57