1 | <?php |
||
16 | class Factory { |
||
17 | /** |
||
18 | * Create a new condition |
||
19 | * |
||
20 | * @param string|array|Closure $options |
||
21 | * @return ConditionInterface |
||
22 | */ |
||
23 | public static function make( $options ) { |
||
38 | |||
39 | /** |
||
40 | * Check if the passed argument is a registered condition type |
||
41 | * |
||
42 | * @param mixed $condition_type |
||
43 | * @return boolean |
||
44 | */ |
||
45 | protected static function conditionTypeRegistered( $condition_type ) { |
||
57 | |||
58 | /** |
||
59 | * Create a new condition from a url |
||
60 | * |
||
61 | * @param string $url |
||
62 | * @return ConditionInterface |
||
63 | */ |
||
64 | protected static function makeFromUrl( $url ) { |
||
67 | |||
68 | /** |
||
69 | * Create a new condition from a closure |
||
70 | * |
||
71 | * @param Closure $closure |
||
72 | * @return ConditionInterface |
||
73 | */ |
||
74 | protected static function makeFromClosure( Closure $closure ) { |
||
77 | |||
78 | /** |
||
79 | * Create a new condition from an array of conditions |
||
80 | * |
||
81 | * @param array $options |
||
82 | * @return ConditionInterface |
||
83 | */ |
||
84 | protected static function makeFromArrayOfConditions( $options ) { |
||
87 | |||
88 | /** |
||
89 | * Create a new condition from an array |
||
90 | * |
||
91 | * @param array $options |
||
92 | * @return ConditionInterface |
||
93 | */ |
||
94 | protected static function makeFromArray( $options ) { |
||
121 | } |
||
122 |