@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | use WebinoViewLib\Feature\CommonView; |
16 | 16 | use WebinoViewLib\Feature\NodeView; |
17 | 17 | |
18 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
18 | +require __DIR__.'/../../vendor/autoload.php'; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Custom view component |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | $event->getNode('display') |
55 | 55 | ->setValue($this->getState()->count); |
56 | 56 | |
57 | - $this->onStateChange('plus', function () { |
|
57 | + $this->onStateChange('plus', function() { |
|
58 | 58 | $this->getState()->count++; |
59 | 59 | }); |
60 | 60 | |
61 | - $this->onStateChange('minus', function () { |
|
61 | + $this->onStateChange('minus', function() { |
|
62 | 62 | $this->getState()->count--; |
63 | 63 | }); |
64 | 64 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $app = Webino::application($config)->bootstrap(); |
82 | 82 | |
83 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
83 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
84 | 84 | $event->setResponse(new ViewResponse); |
85 | 85 | }); |
86 | 86 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | // new ConfigFeature\ConfigCacheEnabled, |
36 | 36 | new AppFeature\FilesystemCache, |
37 | 37 | |
38 | - ['responseText' => 'Random: ' . rand(9, 9999)], |
|
38 | + ['responseText' => 'Random: '.rand(9, 9999)], |
|
39 | 39 | |
40 | 40 | new AppFeature\CoreListener(MyCoreListener::class), |
41 | 41 |
@@ -333,10 +333,10 @@ |
||
333 | 333 | // todo configurable locators |
334 | 334 | $table = $doc->locate('table'); |
335 | 335 | $table->locate('thead th') |
336 | - ->loop(array_keys(current($data)), function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
337 | - // TODO emit event |
|
338 | - $node->setValue($data); |
|
339 | - }); |
|
336 | + ->loop(array_keys(current($data)), function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
337 | + // TODO emit event |
|
338 | + $node->setValue($data); |
|
339 | + }); |
|
340 | 340 | |
341 | 341 | $table->locate('tbody tr') |
342 | 342 | ->loop($data, function (\WebinoDomLib\Dom\NodeList $node, $data) { |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | //dd($app->url('something', ['paramtest' => '123456'])); |
45 | 45 | |
46 | 46 | |
47 | -$app->bind(RouteEvent::NO_MATCH, function (DispatchEvent $event) { |
|
47 | +$app->bind(RouteEvent::NO_MATCH, function(DispatchEvent $event) { |
|
48 | 48 | $event->setResponseContent('404 NOT FOUND'); |
49 | 49 | }); |
50 | 50 | |
51 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) use ($app) { |
|
51 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) use ($app) { |
|
52 | 52 | |
53 | 53 | $event->setResponseContent('<p>Default Route</p>'); |
54 | 54 | |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | // echo '<p>Default Something</p>'; |
61 | 61 | //}); |
62 | 62 | |
63 | -$app->bindRoute('something', function (RouteEvent $event) { |
|
63 | +$app->bindRoute('something', function(RouteEvent $event) { |
|
64 | 64 | |
65 | 65 | // dd($event->getRequest()->getBaseUrl()); |
66 | 66 | |
67 | 67 | // dd($event->getRouteParam('paramtest')); |
68 | 68 | |
69 | - $event->setResponseContent('<p>Default Something X ' . $event->getParam('paramtest') . '</p>'); |
|
69 | + $event->setResponseContent('<p>Default Something X '.$event->getParam('paramtest').'</p>'); |
|
70 | 70 | }, AppEvent::FINISH); |
71 | 71 | |
72 | -$app->bindRoute('something', function (RouteEvent $event) use ($app) { |
|
72 | +$app->bindRoute('something', function(RouteEvent $event) use ($app) { |
|
73 | 73 | $event->setResponseContent('<p>Default Something 2</p>'); |
74 | 74 | $event->setResponseContent($app->url(DefaultRoute::class)->html('Test link to home')->setTitle('Bla bla bla')->setClass('x')); |
75 | 75 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | // TODO route lisetner |
85 | 85 | |
86 | -$app->bind(AppEvent::DISPATCH, function (DispatchEvent $event) use ($app) { |
|
86 | +$app->bind(AppEvent::DISPATCH, function(DispatchEvent $event) use ($app) { |
|
87 | 87 | |
88 | 88 | // dd($event->getApp()); |
89 | 89 | // dd($event->getRequest()); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // TODO |
151 | 151 | //$app->bind(DrawEvent::RENDER, function (DrawEvent $event) { |
152 | -$app->bind('render.html', function (DispatchEvent $event) { |
|
152 | +$app->bind('render.html', function(DispatchEvent $event) { |
|
153 | 153 | |
154 | 154 | /** @var \WebinoDomLib\Dom $html */ |
155 | 155 | $doc = $event->getParam('doc'); |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | |
182 | 182 | }); |
183 | 183 | |
184 | -$app->bind(DefaultRoute::class, function () use ($app) { |
|
185 | - $app->bind('render.html', function (DispatchEvent $event) { |
|
184 | +$app->bind(DefaultRoute::class, function() use ($app) { |
|
185 | + $app->bind('render.html', function(DispatchEvent $event) { |
|
186 | 186 | |
187 | 187 | /** @var \WebinoDomLib\Dom $doc */ |
188 | 188 | $doc = $event->getParam('doc'); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | }); |
198 | 198 | |
199 | 199 | // TODO HTML layout listener |
200 | -$app->bind(AppEvent::DISPATCH, function (DispatchEvent $event) { |
|
200 | +$app->bind(AppEvent::DISPATCH, function(DispatchEvent $event) { |
|
201 | 201 | |
202 | 202 | $content = $event->getResponse()->getContent(); |
203 | 203 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $events = $renderer->getEventManager(); |
237 | 237 | |
238 | 238 | // setting a value |
239 | - $events->attach('render', function ($event) { |
|
239 | + $events->attach('render', function($event) { |
|
240 | 240 | |
241 | 241 | $node = $event->getParam('node'); |
242 | 242 | $spec = $event->getParam('spec'); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | }); |
247 | 247 | |
248 | 248 | // setting an html |
249 | - $events->attach('render', function ($event) { |
|
249 | + $events->attach('render', function($event) { |
|
250 | 250 | |
251 | 251 | $node = $event->getParam('node'); |
252 | 252 | $spec = $event->getParam('spec'); |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | |
255 | 255 | // todo replace placeholders |
256 | 256 | $innerHtml = $node->getInnerHtml(); |
257 | - $html = $innerHtml . $html; |
|
257 | + $html = $innerHtml.$html; |
|
258 | 258 | |
259 | 259 | empty($html) or $node->setHtml($html); |
260 | 260 | }); |
261 | 261 | |
262 | 262 | // TODO components render listener |
263 | 263 | // components |
264 | - $events->attach('render', function (\Zend\EventManager\Event $event) { |
|
264 | + $events->attach('render', function(\Zend\EventManager\Event $event) { |
|
265 | 265 | /** @var \WebinoDomLib\State\Spec $spec */ |
266 | 266 | $spec = $event->getParam('spec'); |
267 | 267 | |
@@ -276,13 +276,13 @@ discard block |
||
276 | 276 | if (class_exists($options['component'])) { |
277 | 277 | $events->trigger($options['component'], $event); |
278 | 278 | } else { |
279 | - $events->trigger('render.component.' . $options['component'], $event); |
|
279 | + $events->trigger('render.component.'.$options['component'], $event); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | }, DispatchEvent::BEGIN * 9); |
283 | 283 | |
284 | 284 | // resolve components data |
285 | - $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function ($event) { |
|
285 | + $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function($event) { |
|
286 | 286 | $spec = $event->getParam('spec'); |
287 | 287 | if (!$spec->hasOption('data')) { |
288 | 288 | return; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | }); |
308 | 308 | |
309 | 309 | // table component |
310 | - $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function (\Zend\EventManager\Event $event) { |
|
310 | + $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function(\Zend\EventManager\Event $event) { |
|
311 | 311 | |
312 | 312 | /** @var \WebinoDomLib\Dom\Element $node */ |
313 | 313 | $node = $event->getParam('node'); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | // todo replace placeholders |
318 | 318 | $innerHtml = $node->getInnerHtml(); |
319 | - $html = $innerHtml . $html; |
|
319 | + $html = $innerHtml.$html; |
|
320 | 320 | |
321 | 321 | $data = $event->getParam('data', []); |
322 | 322 | if (empty($data)) { |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | // todo configurable locators |
334 | 334 | $table = $doc->locate('table'); |
335 | 335 | $table->locate('thead th') |
336 | - ->loop(array_keys(current($data)), function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
336 | + ->loop(array_keys(current($data)), function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
337 | 337 | // TODO emit event |
338 | 338 | $node->setValue($data); |
339 | 339 | }); |
340 | 340 | |
341 | 341 | $table->locate('tbody tr') |
342 | - ->loop($data, function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
342 | + ->loop($data, function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
343 | 343 | |
344 | 344 | $node->locate('td') |
345 | - ->loop($data, function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
345 | + ->loop($data, function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
346 | 346 | // TODO emit event |
347 | 347 | $node->setValue($data); |
348 | 348 | }); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | |
376 | 376 | //$app->bind(AppEvent::DISPATCH, MyListener::class, AppEvent::BEGIN); |
377 | 377 | |
378 | -$app->bind(AppEvent::DISPATCH, function () use ($app) { |
|
378 | +$app->bind(AppEvent::DISPATCH, function() use ($app) { |
|
379 | 379 | // undefined(); |
380 | 380 | // echo 'Svet'; |
381 | 381 |
@@ -104,7 +104,7 @@ |
||
104 | 104 | */ |
105 | 105 | public function onConfig(callable $callback) |
106 | 106 | { |
107 | - $this->bind(AppEvent::CONFIGURE, function (AppEvent $event) use ($callback) { |
|
107 | + $this->bind(AppEvent::CONFIGURE, function(AppEvent $event) use ($callback) { |
|
108 | 108 | $event->getApp()->setConfig(call_user_func($callback)); |
109 | 109 | }); |
110 | 110 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $modules = $app->get(Modules::class); |
20 | 20 | $modules->loadModules($this->getDependencies()); |
21 | 21 | |
22 | - $app->onConfig(function () { |
|
22 | + $app->onConfig(function() { |
|
23 | 23 | return $this->getConfig(); |
24 | 24 | }); |
25 | 25 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $routeEvent->setEventParam(AbstractRouteEvent::ROUTE_MATCH, $routeMatch); |
44 | 44 | |
45 | 45 | // binding to a route match to emit matched route event |
46 | - $app->bind(AbstractRouteEvent::MATCH, function (AbstractRouteEvent $event) use ($app, $routeMatch) { |
|
46 | + $app->bind(AbstractRouteEvent::MATCH, function(AbstractRouteEvent $event) use ($app, $routeMatch) { |
|
47 | 47 | $routeEvent = clone $event; |
48 | 48 | $routeEvent->setName($routeMatch->getMatchedRouteName()); |
49 | 49 |
@@ -10,5 +10,5 @@ |
||
10 | 10 | /** |
11 | 11 | * Path to the public asynchronous pipe file |
12 | 12 | */ |
13 | - const FILE = __DIR__ . '/../../../inc/pipe.php'; |
|
13 | + const FILE = __DIR__.'/../../../inc/pipe.php'; |
|
14 | 14 | } |
@@ -10,5 +10,5 @@ |
||
10 | 10 | /** |
11 | 11 | * Path to the public entry point file |
12 | 12 | */ |
13 | - const FILE = __DIR__ . '/../../../inc/index.php'; |
|
13 | + const FILE = __DIR__.'/../../../inc/index.php'; |
|
14 | 14 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | public function __toString() |
29 | 29 | { |
30 | 30 | return sprintf( |
31 | - file_get_contents(__DIR__ . '/resources/source-preview.html'), |
|
31 | + file_get_contents(__DIR__.'/resources/source-preview.html'), |
|
32 | 32 | highlight_file($this->path, true) |
33 | 33 | ); |
34 | 34 | } |