@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use WebinoAppLib\Router\DefaultRoute; |
12 | 12 | use Zend\ServiceManager\ServiceLocatorInterface; |
13 | 13 | |
14 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
14 | +require __DIR__.'/../../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Custom service |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | $app->set(MyService::class, MyServiceFactory::class); |
50 | 50 | |
51 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
51 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
52 | 52 | /** |
53 | 53 | * Obtaining a |
54 | 54 | * service instance. |
@@ -4,7 +4,6 @@ |
||
4 | 4 | * Webino Example |
5 | 5 | */ |
6 | 6 | |
7 | -use WebinoAppLib\Application\CoreConfig; |
|
8 | 7 | use WebinoAppLib\Event\RouteEvent; |
9 | 8 | use WebinoAppLib\Feature\Service; |
10 | 9 | use WebinoAppLib\Response\Content\SourcePreview; |
@@ -1,1 +1,1 @@ |
||
1 | -<?php require __DIR__ . '/../logger-custom/index.php'; |
|
1 | +<?php require __DIR__.'/../logger-custom/index.php'; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | use WebinoAppLib\Response\Content\SourcePreview; |
13 | 13 | use WebinoAppLib\Router\DefaultRoute; |
14 | 14 | |
15 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
15 | +require __DIR__.'/../../vendor/autoload.php'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Custom base module |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * Binding to default route |
48 | 48 | * from the custom module. |
49 | 49 | */ |
50 | - $app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
50 | + $app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
51 | 51 | /** |
52 | 52 | * Obtaining custom |
53 | 53 | * module service. |
@@ -1,1 +1,1 @@ |
||
1 | -<?php require __DIR__ . '/../service-factory-config/index.php'; |
|
1 | +<?php require __DIR__.'/../service-factory-config/index.php'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use WebinoConfigLib\Feature\SmtpMailer; |
12 | 12 | use WebinoConfigLib\Feature\Route; |
13 | 13 | |
14 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
14 | +require __DIR__.'/../../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | $config = Webino::config([ |
17 | 17 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $app = Webino::application($config)->bootstrap(); |
31 | 31 | |
32 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
32 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
33 | 33 | |
34 | 34 | // TODO message config |
35 | 35 | $event->getApp()->mail()->getMessage()->setFrom('[email protected]'); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use WebinoAppLib\Response\Content\SourcePreview; |
12 | 12 | use WebinoAppLib\Router\DefaultRoute; |
13 | 13 | |
14 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
14 | +require __DIR__.'/../../vendor/autoload.php'; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Custom service |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | $app->set(MyService::class, new MyServiceFactory); |
50 | 50 | |
51 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
51 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
52 | 52 | /** |
53 | 53 | * Obtaining service |
54 | 54 | * instance. |
@@ -4,7 +4,6 @@ |
||
4 | 4 | * Webino Example |
5 | 5 | */ |
6 | 6 | |
7 | -use WebinoAppLib\Application\CoreConfig; |
|
8 | 7 | use WebinoAppLib\Event\RouteEvent; |
9 | 8 | use WebinoAppLib\Factory\AbstractFactory; |
10 | 9 | use WebinoAppLib\Feature\Service; |
@@ -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->setResponse('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->setResponse('<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->setResponse('<p>Default Something X ' . $event->getParam('paramtest') . '</p>'); |
|
69 | + $event->setResponse('<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->setResponse('<p>Default Something 2</p>'); |
74 | 74 | $event->setResponse($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 |