1 | <?php |
||
30 | class VarsServiceProvider implements ServiceProviderInterface |
||
31 | { |
||
32 | /** |
||
33 | * The entity to use Vars with |
||
34 | * |
||
35 | * @var null |
||
36 | */ |
||
37 | private $entity; |
||
38 | |||
39 | /** |
||
40 | * The available option keys |
||
41 | * |
||
42 | * @var array |
||
43 | */ |
||
44 | private $option_keys = array( |
||
45 | 'cache', |
||
46 | 'cache_path', |
||
47 | 'cache_expire', |
||
48 | 'loaders', |
||
49 | 'variables' |
||
50 | ); |
||
51 | |||
52 | /** |
||
53 | * The service provider constructor sets the entity to use with vars |
||
54 | * |
||
55 | * @param mixed $entity The entity |
||
56 | */ |
||
57 | 3 | public function __construct($entity = null) |
|
61 | |||
62 | /** |
||
63 | * Registers the service provider, sets the user defined options and returns the vars instance |
||
64 | * |
||
65 | * @param \Silex\Application $app The silex app |
||
66 | */ |
||
67 | public function register(Application $app) |
||
73 | |||
74 | /** |
||
75 | * Creates the defined options into a way that Vars can use |
||
76 | * |
||
77 | * @param \Silex\Application $app The silex app |
||
78 | * |
||
79 | * @return array The created options |
||
80 | */ |
||
81 | 3 | private function createOptions($app) |
|
100 | |||
101 | /** |
||
102 | * Registers the service provider, sets the user defined options and returns the vars instance |
||
103 | * |
||
104 | * @param array $options The already parsed options |
||
105 | * @param array $vars_options The options defined in the Silex app |
||
106 | * |
||
107 | * @return array The keyed options |
||
108 | */ |
||
109 | 2 | private function createKeyedOptions($options, $vars_options) |
|
117 | |||
118 | /** |
||
119 | * The silex service provider boot function |
||
120 | * |
||
121 | * @param \Silex\Application $app The silex app |
||
122 | * |
||
123 | * @codeCoverageIgnore |
||
124 | */ |
||
125 | public function boot(Application $app) |
||
128 | } |
||
129 |