@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | new Route('/auth/<action>', new Controller(AuthController::class)) |
90 | 90 | ); |
91 | 91 | |
92 | - $views->addDirectory('custom', __DIR__ . '/../../views/custom/'); |
|
92 | + $views->addDirectory('custom', __DIR__.'/../../views/custom/'); |
|
93 | 93 | $views->addEngine(TestEngine::class); |
94 | 94 | |
95 | 95 | $validation->addAlias('aliased', 'notEmpty'); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | { |
174 | 174 | $core = new InterceptableCore($this->core); |
175 | 175 | |
176 | - foreach ($interceptors as $interceptor) { |
|
176 | + foreach ($interceptors as $interceptor){ |
|
177 | 177 | $core->addInterceptor(is_object($interceptor) ? $interceptor : $this->container->get($interceptor)); |
178 | 178 | } |
179 | 179 |
@@ -173,7 +173,8 @@ |
||
173 | 173 | { |
174 | 174 | $core = new InterceptableCore($this->core); |
175 | 175 | |
176 | - foreach ($interceptors as $interceptor) { |
|
176 | + foreach ($interceptors as $interceptor) |
|
177 | + { |
|
177 | 178 | $core->addInterceptor(is_object($interceptor) ? $interceptor : $this->container->get($interceptor)); |
178 | 179 | } |
179 | 180 |
@@ -66,8 +66,8 @@ |
||
66 | 66 | */ |
67 | 67 | public function compiler(ContainerInterface $container, Compiler $compiler, GridConfig $config): Compiler |
68 | 68 | { |
69 | - if ($container->has(DatabaseInterface::class)) { |
|
70 | - foreach ($config->getWriters() as $writer) { |
|
69 | + if ($container->has(DatabaseInterface::class)){ |
|
70 | + foreach ($config->getWriters() as $writer){ |
|
71 | 71 | $compiler->addWriter($container->get($writer)); |
72 | 72 | } |
73 | 73 | } |
@@ -66,8 +66,10 @@ |
||
66 | 66 | */ |
67 | 67 | public function compiler(ContainerInterface $container, Compiler $compiler, GridConfig $config): Compiler |
68 | 68 | { |
69 | - if ($container->has(DatabaseInterface::class)) { |
|
70 | - foreach ($config->getWriters() as $writer) { |
|
69 | + if ($container->has(DatabaseInterface::class)) |
|
70 | + { |
|
71 | + foreach ($config->getWriters() as $writer) |
|
72 | + { |
|
71 | 73 | $compiler->addWriter($container->get($writer)); |
72 | 74 | } |
73 | 75 | } |
@@ -35,20 +35,20 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
37 | 37 | { |
38 | - if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween) { |
|
38 | + if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween){ |
|
39 | 39 | $filters = $specification->getFilters($this->asOriginal); |
40 | - if (count($filters) > 1) { |
|
40 | + if (count($filters) > 1){ |
|
41 | 41 | return $source->where(static function () use ($compiler, $source, $filters): void { |
42 | 42 | $compiler->compile($source, ...$filters); |
43 | 43 | }); |
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
47 | - if ($specification instanceof Filter\InjectionFilter) { |
|
47 | + if ($specification instanceof Filter\InjectionFilter){ |
|
48 | 48 | $expression = $specification->getFilter(); |
49 | - if ($expression instanceof Filter\Between) { |
|
49 | + if ($expression instanceof Filter\Between){ |
|
50 | 50 | $filters = $expression->getFilters($this->asOriginal); |
51 | - if (count($filters) > 1) { |
|
51 | + if (count($filters) > 1){ |
|
52 | 52 | $filters = array_map( |
53 | 53 | static function (SpecificationInterface $filter) use ($specification): Filter\InjectionFilter { |
54 | 54 | return Filter\InjectionFilter::createFrom($specification, $filter); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
74 | - if ($specification instanceof Filter\Between) { |
|
74 | + if ($specification instanceof Filter\Between){ |
|
75 | 75 | return $source->where( |
76 | 76 | $specification->getExpression(), |
77 | 77 | 'BETWEEN', |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ); |
80 | 80 | } |
81 | 81 | |
82 | - if ($specification instanceof Filter\ValueBetween) { |
|
82 | + if ($specification instanceof Filter\ValueBetween){ |
|
83 | 83 | return $source->where( |
84 | 84 | new Parameter($specification->getValue()), |
85 | 85 | 'BETWEEN', |
@@ -35,20 +35,25 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function write($source, SpecificationInterface $specification, Compiler $compiler) |
37 | 37 | { |
38 | - if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween) { |
|
38 | + if ($specification instanceof Filter\Between || $specification instanceof Filter\ValueBetween) |
|
39 | + { |
|
39 | 40 | $filters = $specification->getFilters($this->asOriginal); |
40 | - if (count($filters) > 1) { |
|
41 | + if (count($filters) > 1) |
|
42 | + { |
|
41 | 43 | return $source->where(static function () use ($compiler, $source, $filters): void { |
42 | 44 | $compiler->compile($source, ...$filters); |
43 | 45 | }); |
44 | 46 | } |
45 | 47 | } |
46 | 48 | |
47 | - if ($specification instanceof Filter\InjectionFilter) { |
|
49 | + if ($specification instanceof Filter\InjectionFilter) |
|
50 | + { |
|
48 | 51 | $expression = $specification->getFilter(); |
49 | - if ($expression instanceof Filter\Between) { |
|
52 | + if ($expression instanceof Filter\Between) |
|
53 | + { |
|
50 | 54 | $filters = $expression->getFilters($this->asOriginal); |
51 | - if (count($filters) > 1) { |
|
55 | + if (count($filters) > 1) |
|
56 | + { |
|
52 | 57 | $filters = array_map( |
53 | 58 | static function (SpecificationInterface $filter) use ($specification): Filter\InjectionFilter { |
54 | 59 | return Filter\InjectionFilter::createFrom($specification, $filter); |
@@ -71,7 +76,8 @@ discard block |
||
71 | 76 | } |
72 | 77 | } |
73 | 78 | |
74 | - if ($specification instanceof Filter\Between) { |
|
79 | + if ($specification instanceof Filter\Between) |
|
80 | + { |
|
75 | 81 | return $source->where( |
76 | 82 | $specification->getExpression(), |
77 | 83 | 'BETWEEN', |
@@ -79,7 +85,8 @@ discard block |
||
79 | 85 | ); |
80 | 86 | } |
81 | 87 | |
82 | - if ($specification instanceof Filter\ValueBetween) { |
|
88 | + if ($specification instanceof Filter\ValueBetween) |
|
89 | + { |
|
83 | 90 | return $source->where( |
84 | 91 | new Parameter($specification->getValue()), |
85 | 92 | 'BETWEEN', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | GridResponseInterface $response, |
49 | 49 | ContainerInterface $container, |
50 | 50 | GridFactory $gridFactory |
51 | - ) { |
|
51 | + ){ |
|
52 | 52 | $this->response = $response; |
53 | 53 | $this->container = $container; |
54 | 54 | $this->gridFactory = $gridFactory; |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | { |
67 | 67 | $result = $core->callAction($controller, $action, $parameters); |
68 | 68 | |
69 | - if (is_iterable($result)) { |
|
69 | + if (is_iterable($result)){ |
|
70 | 70 | $schema = $this->getSchema($controller, $action); |
71 | - if ($schema !== null) { |
|
71 | + if ($schema !== null){ |
|
72 | 72 | $grid = $this->makeFactory($schema) |
73 | 73 | ->withDefaults($schema['defaults']) |
74 | 74 | ->create($result, $schema['grid']); |
75 | 75 | |
76 | - if ($schema['view'] !== null) { |
|
76 | + if ($schema['view'] !== null){ |
|
77 | 77 | $grid = $grid->withView($schema['view']); |
78 | 78 | } |
79 | 79 | |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | private function getSchema(string $controller, string $action): ?array |
94 | 94 | { |
95 | 95 | $key = sprintf('%s:%s', $controller, $action); |
96 | - if (array_key_exists($key, $this->cache)) { |
|
96 | + if (array_key_exists($key, $this->cache)){ |
|
97 | 97 | return $this->cache[$key]; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $this->cache[$key] = null; |
101 | - try { |
|
101 | + try{ |
|
102 | 102 | $method = new \ReflectionMethod($controller, $action); |
103 | - } catch (\ReflectionException $e) { |
|
103 | + }catch (\ReflectionException $e){ |
|
104 | 104 | return null; |
105 | 105 | } |
106 | 106 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | /** @var DataGrid $dataGrid */ |
110 | 110 | $dataGrid = $reader->getMethodAnnotation($method, DataGrid::class); |
111 | - if ($dataGrid === null) { |
|
111 | + if ($dataGrid === null){ |
|
112 | 112 | return null; |
113 | 113 | } |
114 | 114 | |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | 'factory' => $dataGrid->factory, |
130 | 130 | ]; |
131 | 131 | |
132 | - if (is_string($schema['view'])) { |
|
132 | + if (is_string($schema['view'])){ |
|
133 | 133 | $schema['view'] = $this->container->get($schema['view']); |
134 | 134 | } |
135 | 135 | |
136 | - if ($schema['defaults'] === [] && method_exists($schema['grid'], 'getDefaults')) { |
|
136 | + if ($schema['defaults'] === [] && method_exists($schema['grid'], 'getDefaults')){ |
|
137 | 137 | $schema['defaults'] = $schema['grid']->getDefaults(); |
138 | 138 | } |
139 | 139 | |
140 | - if ($schema['options'] === [] && method_exists($schema['grid'], 'getOptions')) { |
|
140 | + if ($schema['options'] === [] && method_exists($schema['grid'], 'getOptions')){ |
|
141 | 141 | $schema['options'] = $schema['grid']->getOptions(); |
142 | 142 | } |
143 | 143 | |
144 | - if ($schema['view'] === null && is_callable($schema['grid'])) { |
|
144 | + if ($schema['view'] === null && is_callable($schema['grid'])){ |
|
145 | 145 | $schema['view'] = $schema['grid']; |
146 | 146 | } |
147 | 147 | |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | |
151 | 151 | private function makeFactory(array $schema): GridFactoryInterface |
152 | 152 | { |
153 | - if (!empty($schema['factory']) && $this->container->has($schema['factory'])) { |
|
153 | + if (!empty($schema['factory']) && $this->container->has($schema['factory'])){ |
|
154 | 154 | $factory = $this->container->get($schema['factory']); |
155 | - if ($factory instanceof GridFactoryInterface) { |
|
155 | + if ($factory instanceof GridFactoryInterface){ |
|
156 | 156 | return $factory; |
157 | 157 | } |
158 | 158 | } |
@@ -66,14 +66,17 @@ discard block |
||
66 | 66 | { |
67 | 67 | $result = $core->callAction($controller, $action, $parameters); |
68 | 68 | |
69 | - if (is_iterable($result)) { |
|
69 | + if (is_iterable($result)) |
|
70 | + { |
|
70 | 71 | $schema = $this->getSchema($controller, $action); |
71 | - if ($schema !== null) { |
|
72 | + if ($schema !== null) |
|
73 | + { |
|
72 | 74 | $grid = $this->makeFactory($schema) |
73 | 75 | ->withDefaults($schema['defaults']) |
74 | 76 | ->create($result, $schema['grid']); |
75 | 77 | |
76 | - if ($schema['view'] !== null) { |
|
78 | + if ($schema['view'] !== null) |
|
79 | + { |
|
77 | 80 | $grid = $grid->withView($schema['view']); |
78 | 81 | } |
79 | 82 | |
@@ -93,14 +96,18 @@ discard block |
||
93 | 96 | private function getSchema(string $controller, string $action): ?array |
94 | 97 | { |
95 | 98 | $key = sprintf('%s:%s', $controller, $action); |
96 | - if (array_key_exists($key, $this->cache)) { |
|
99 | + if (array_key_exists($key, $this->cache)) |
|
100 | + { |
|
97 | 101 | return $this->cache[$key]; |
98 | 102 | } |
99 | 103 | |
100 | 104 | $this->cache[$key] = null; |
101 | - try { |
|
105 | + try |
|
106 | + { |
|
102 | 107 | $method = new \ReflectionMethod($controller, $action); |
103 | - } catch (\ReflectionException $e) { |
|
108 | + } |
|
109 | + catch (\ReflectionException $e) |
|
110 | + { |
|
104 | 111 | return null; |
105 | 112 | } |
106 | 113 | |
@@ -108,7 +115,8 @@ discard block |
||
108 | 115 | |
109 | 116 | /** @var DataGrid $dataGrid */ |
110 | 117 | $dataGrid = $reader->getMethodAnnotation($method, DataGrid::class); |
111 | - if ($dataGrid === null) { |
|
118 | + if ($dataGrid === null) |
|
119 | + { |
|
112 | 120 | return null; |
113 | 121 | } |
114 | 122 | |
@@ -129,19 +137,23 @@ discard block |
||
129 | 137 | 'factory' => $dataGrid->factory, |
130 | 138 | ]; |
131 | 139 | |
132 | - if (is_string($schema['view'])) { |
|
140 | + if (is_string($schema['view'])) |
|
141 | + { |
|
133 | 142 | $schema['view'] = $this->container->get($schema['view']); |
134 | 143 | } |
135 | 144 | |
136 | - if ($schema['defaults'] === [] && method_exists($schema['grid'], 'getDefaults')) { |
|
145 | + if ($schema['defaults'] === [] && method_exists($schema['grid'], 'getDefaults')) |
|
146 | + { |
|
137 | 147 | $schema['defaults'] = $schema['grid']->getDefaults(); |
138 | 148 | } |
139 | 149 | |
140 | - if ($schema['options'] === [] && method_exists($schema['grid'], 'getOptions')) { |
|
150 | + if ($schema['options'] === [] && method_exists($schema['grid'], 'getOptions')) |
|
151 | + { |
|
141 | 152 | $schema['options'] = $schema['grid']->getOptions(); |
142 | 153 | } |
143 | 154 | |
144 | - if ($schema['view'] === null && is_callable($schema['grid'])) { |
|
155 | + if ($schema['view'] === null && is_callable($schema['grid'])) |
|
156 | + { |
|
145 | 157 | $schema['view'] = $schema['grid']; |
146 | 158 | } |
147 | 159 | |
@@ -150,9 +162,11 @@ discard block |
||
150 | 162 | |
151 | 163 | private function makeFactory(array $schema): GridFactoryInterface |
152 | 164 | { |
153 | - if (!empty($schema['factory']) && $this->container->has($schema['factory'])) { |
|
165 | + if (!empty($schema['factory']) && $this->container->has($schema['factory'])) |
|
166 | + { |
|
154 | 167 | $factory = $this->container->get($schema['factory']); |
155 | - if ($factory instanceof GridFactoryInterface) { |
|
168 | + if ($factory instanceof GridFactoryInterface) |
|
169 | + { |
|
156 | 170 | return $factory; |
157 | 171 | } |
158 | 172 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function jsonSerialize(): array |
47 | 47 | { |
48 | - if ($this->grid === null) { |
|
48 | + if ($this->grid === null){ |
|
49 | 49 | return [ |
50 | 50 | 'status' => 500, |
51 | 51 | 'error' => 'missing-grid-source', |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | $this->option('property', 'data') => $this->data, |
58 | 58 | ]; |
59 | 59 | |
60 | - if ($this->grid->getOption(GridInterface::PAGINATOR) !== null) { |
|
60 | + if ($this->grid->getOption(GridInterface::PAGINATOR) !== null){ |
|
61 | 61 | $response['pagination'] = $this->grid->getOption(GridInterface::PAGINATOR); |
62 | 62 | } |
63 | 63 | |
64 | - if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null) { |
|
64 | + if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null){ |
|
65 | 65 | $response['pagination']['count'] = $this->grid->getOption(GridInterface::COUNT); |
66 | 66 | } |
67 | 67 |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function jsonSerialize(): array |
47 | 47 | { |
48 | - if ($this->grid === null) { |
|
48 | + if ($this->grid === null) |
|
49 | + { |
|
49 | 50 | return [ |
50 | 51 | 'status' => 500, |
51 | 52 | 'error' => 'missing-grid-source', |
@@ -57,11 +58,13 @@ discard block |
||
57 | 58 | $this->option('property', 'data') => $this->data, |
58 | 59 | ]; |
59 | 60 | |
60 | - if ($this->grid->getOption(GridInterface::PAGINATOR) !== null) { |
|
61 | + if ($this->grid->getOption(GridInterface::PAGINATOR) !== null) |
|
62 | + { |
|
61 | 63 | $response['pagination'] = $this->grid->getOption(GridInterface::PAGINATOR); |
62 | 64 | } |
63 | 65 | |
64 | - if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null) { |
|
66 | + if (isset($response['pagination']) && $this->grid->getOption(GridInterface::COUNT) !== null) |
|
67 | + { |
|
65 | 68 | $response['pagination']['count'] = $this->grid->getOption(GridInterface::COUNT); |
66 | 69 | } |
67 | 70 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function __construct(SpecificationInterface $expression) |
27 | 27 | { |
28 | - if (!$expression instanceof Expression && !$expression instanceof Between) { |
|
28 | + if (!$expression instanceof Expression && !$expression instanceof Between){ |
|
29 | 29 | throw new LogicException('Only expression filters allowed'); |
30 | 30 | } |
31 | 31 |
@@ -25,7 +25,8 @@ |
||
25 | 25 | |
26 | 26 | public function __construct(SpecificationInterface $expression) |
27 | 27 | { |
28 | - if (!$expression instanceof Expression && !$expression instanceof Between) { |
|
28 | + if (!$expression instanceof Expression && !$expression instanceof Between) |
|
29 | + { |
|
29 | 30 | throw new LogicException('Only expression filters allowed'); |
30 | 31 | } |
31 | 32 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $this->db->table('users')->select('*'), |
131 | 131 | $schema |
132 | 132 | ) |
133 | - ->withView(static function ($u) { |
|
133 | + ->withView(static function ($u){ |
|
134 | 134 | return $u['name']; |
135 | 135 | }); |
136 | 136 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->db->table('users')->select('*'), |
161 | 161 | $schema |
162 | 162 | ) |
163 | - ->withView(static function ($u) { |
|
163 | + ->withView(static function ($u){ |
|
164 | 164 | return $u['name']; |
165 | 165 | }); |
166 | 166 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $this->db->table('users')->select('*'), |
190 | 190 | $schema |
191 | 191 | ) |
192 | - ->withView(static function ($u) { |
|
192 | + ->withView(static function ($u){ |
|
193 | 193 | return $u['name']; |
194 | 194 | }); |
195 | 195 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | $this->db->table('users')->select('*'), |
219 | 219 | $schema |
220 | 220 | ) |
221 | - ->withView(static function ($u) { |
|
221 | + ->withView(static function ($u){ |
|
222 | 222 | return $u['name']; |
223 | 223 | }); |
224 | 224 |
@@ -130,7 +130,8 @@ discard block |
||
130 | 130 | $this->db->table('users')->select('*'), |
131 | 131 | $schema |
132 | 132 | ) |
133 | - ->withView(static function ($u) { |
|
133 | + ->withView(static function ($u) |
|
134 | + { |
|
134 | 135 | return $u['name']; |
135 | 136 | }); |
136 | 137 | |
@@ -160,7 +161,8 @@ discard block |
||
160 | 161 | $this->db->table('users')->select('*'), |
161 | 162 | $schema |
162 | 163 | ) |
163 | - ->withView(static function ($u) { |
|
164 | + ->withView(static function ($u) |
|
165 | + { |
|
164 | 166 | return $u['name']; |
165 | 167 | }); |
166 | 168 | |
@@ -189,7 +191,8 @@ discard block |
||
189 | 191 | $this->db->table('users')->select('*'), |
190 | 192 | $schema |
191 | 193 | ) |
192 | - ->withView(static function ($u) { |
|
194 | + ->withView(static function ($u) |
|
195 | + { |
|
193 | 196 | return $u['name']; |
194 | 197 | }); |
195 | 198 | |
@@ -218,7 +221,8 @@ discard block |
||
218 | 221 | $this->db->table('users')->select('*'), |
219 | 222 | $schema |
220 | 223 | ) |
221 | - ->withView(static function ($u) { |
|
224 | + ->withView(static function ($u) |
|
225 | + { |
|
222 | 226 | return $u['name']; |
223 | 227 | }); |
224 | 228 |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | ) |
117 | 117 | ); |
118 | 118 | |
119 | - if ($resultDirection === null) { |
|
119 | + if ($resultDirection === null){ |
|
120 | 120 | $this->assertNull($sorter->withDirection($direction)); |
121 | - } else { |
|
121 | + }else{ |
|
122 | 122 | $select = $this->compile( |
123 | 123 | $this->initQuery(), |
124 | 124 | $sorter->withDirection($direction) |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | { |
177 | 177 | $sorter = new Sorter\Sorter('balance', 'credits'); |
178 | 178 | |
179 | - if ($resultDirection === null) { |
|
179 | + if ($resultDirection === null){ |
|
180 | 180 | $this->assertNull($sorter->withDirection($direction)); |
181 | - } else { |
|
181 | + }else{ |
|
182 | 182 | $select = $this->compile( |
183 | 183 | $this->initQuery(), |
184 | 184 | $sorter->withDirection($direction) |
@@ -116,9 +116,12 @@ discard block |
||
116 | 116 | ) |
117 | 117 | ); |
118 | 118 | |
119 | - if ($resultDirection === null) { |
|
119 | + if ($resultDirection === null) |
|
120 | + { |
|
120 | 121 | $this->assertNull($sorter->withDirection($direction)); |
121 | - } else { |
|
122 | + } |
|
123 | + else |
|
124 | + { |
|
122 | 125 | $select = $this->compile( |
123 | 126 | $this->initQuery(), |
124 | 127 | $sorter->withDirection($direction) |
@@ -176,9 +179,12 @@ discard block |
||
176 | 179 | { |
177 | 180 | $sorter = new Sorter\Sorter('balance', 'credits'); |
178 | 181 | |
179 | - if ($resultDirection === null) { |
|
182 | + if ($resultDirection === null) |
|
183 | + { |
|
180 | 184 | $this->assertNull($sorter->withDirection($direction)); |
181 | - } else { |
|
185 | + } |
|
186 | + else |
|
187 | + { |
|
182 | 188 | $select = $this->compile( |
183 | 189 | $this->initQuery(), |
184 | 190 | $sorter->withDirection($direction) |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $views->addEngine(StemplerEngine::class); |
97 | 97 | |
98 | - if ($container->has(LocaleProcessor::class)) { |
|
98 | + if ($container->has(LocaleProcessor::class)){ |
|
99 | 99 | $this->addProcessor(LocaleProcessor::class); |
100 | 100 | } |
101 | 101 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | { |
131 | 131 | $this->config->modify( |
132 | 132 | 'views/stempler', |
133 | - new Append('visitors.' . (string)$stage, null, $visitor) |
|
133 | + new Append('visitors.'.(string)$stage, null, $visitor) |
|
134 | 134 | ); |
135 | 135 | } |
136 | 136 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | ViewsConfig $viewConfig |
147 | 147 | ): StemplerEngine { |
148 | 148 | $cache = null; |
149 | - if ($viewConfig->isCacheEnabled()) { |
|
149 | + if ($viewConfig->isCacheEnabled()){ |
|
150 | 150 | $cache = new StemplerCache($viewConfig->getCacheDirectory()); |
151 | 151 | } |
152 | 152 |
@@ -95,7 +95,8 @@ discard block |
||
95 | 95 | |
96 | 96 | $views->addEngine(StemplerEngine::class); |
97 | 97 | |
98 | - if ($container->has(LocaleProcessor::class)) { |
|
98 | + if ($container->has(LocaleProcessor::class)) |
|
99 | + { |
|
99 | 100 | $this->addProcessor(LocaleProcessor::class); |
100 | 101 | } |
101 | 102 | } |
@@ -146,7 +147,8 @@ discard block |
||
146 | 147 | ViewsConfig $viewConfig |
147 | 148 | ): StemplerEngine { |
148 | 149 | $cache = null; |
149 | - if ($viewConfig->isCacheEnabled()) { |
|
150 | + if ($viewConfig->isCacheEnabled()) |
|
151 | + { |
|
150 | 152 | $cache = new StemplerCache($viewConfig->getCacheDirectory()); |
151 | 153 | } |
152 | 154 |