1 | <?php |
||
16 | class Helper |
||
17 | { |
||
18 | 1 | public static function configure($object, array $config) |
|
26 | |||
27 | /** |
||
28 | * Very straightforward object creator. |
||
29 | */ |
||
30 | 1 | public static function createObject(array $config) |
|
38 | |||
39 | /** |
||
40 | * Creates merchant according to given config. |
||
41 | */ |
||
42 | 1 | public static function create(array $config) |
|
49 | |||
50 | 1 | public static function findClass($gateway, $library, $what) |
|
57 | |||
58 | /** |
||
59 | * Builds class name: hiqdev\php\merchant\gateway\LibraryWhat. |
||
60 | */ |
||
61 | 1 | public static function buildClass($gateway, $library, $what) |
|
66 | |||
67 | /** |
||
68 | * Converts an ID into a CamelCase name. |
||
69 | * Words in the ID separated by `$separator` (defaults to '-') will be concatenated into a CamelCase name. |
||
70 | * For example, 'post-tag' is converted to 'PostTag'. |
||
71 | * Taken from Yii 2 Inflector. |
||
72 | * |
||
73 | * @param string $id the ID to be converted |
||
74 | * @param string $separator the character used to separate the words in the ID |
||
75 | * |
||
76 | * @return string the resulting CamelCase name |
||
77 | */ |
||
78 | 2 | public static function id2camel($id, $separator = '-') |
|
82 | |||
83 | /** |
||
84 | * Converts to simple name - only lowercase letters and numbers. |
||
85 | */ |
||
86 | 2 | public static function simplify($name) |
|
90 | |||
91 | /** |
||
92 | * Converts time to ISO 8601 format. |
||
93 | */ |
||
94 | public static function isotime($time) |
||
98 | |||
99 | 1 | public static function formatMoney($sum, $decimals = 2) |
|
103 | } |
||
104 |