Completed
Push — prototype ( 3bfdd7...aec713 )
by Peter
07:47
created
examples/simple/public/logger-aware-custom/index.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,6 @@
 block discarded – undo
10 10
 use WebinoAppLib\Response\Content\SourcePreview;
11 11
 use WebinoAppLib\Router\DefaultRoute;
12 12
 use WebinoExamplesLib\Html\FieldSetScrollBox;
13
-use WebinoHtmlLib\Html;
14
-use WebinoExamplesLib\Html\ScrollBox;
15 13
 use WebinoConfigLib\Feature\Log;
16 14
 use WebinoConfigLib\Feature\Logger;
17 15
 use WebinoLogLib\LoggerAwareInterface;
Please login to merge, or discard this patch.
examples/simple/public/service-factory-class-invokable/index.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
examples/simple/public/service-factory-class/index.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
examples/simple/public/service-factory-closure/index.php 1 patch
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,7 @@
 block discarded – undo
4 4
  * Webino Example
5 5
  */
6 6
 
7
-use WebinoAppLib\Application\CoreConfig;
8 7
 use WebinoAppLib\Event\RouteEvent;
9
-use WebinoAppLib\Factory\AbstractFactory;
10 8
 use WebinoAppLib\Feature\Service;
11 9
 use WebinoAppLib\Response\Content\SourcePreview;
12 10
 use WebinoAppLib\Router\DefaultRoute;
Please login to merge, or discard this patch.
examples/simple/public/service-factory-object-invokable/index.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
examples/simple/public/service-factory-object/index.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
examples/skeleton-application/dispatch.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
examples/basic-usage/index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 {
27 27
     public function init()
28 28
     {
29
-        $this->listen(AppEvent::DISPATCH, function (DispatchEvent $event) {
29
+        $this->listen(AppEvent::DISPATCH, function(DispatchEvent $event) {
30 30
             $event->setResponse($event->getApp()->file()->read('docs/common.html'));
31 31
         }, AppEvent::BEGIN);
32 32
 
33
-        $this->listen(AppEvent::DISPATCH, function (DispatchEvent $event) {
33
+        $this->listen(AppEvent::DISPATCH, function(DispatchEvent $event) {
34 34
             $event->setResponse($event->getApp()->file()->read('docs/footer.html'));
35 35
         }, AppEvent::FINISH);
36 36
 
37
-        $this->listen(DefaultRoute::class, function (RouteEvent $event) {
37
+        $this->listen(DefaultRoute::class, function(RouteEvent $event) {
38 38
             $event->setResponse([
39 39
                 '<h1>Webino Application Basic Usage Example</h1>',
40 40
                 $event->getApp()->url('myRoute')->html('My Route Example'),
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
             ]);
44 44
         });
45 45
 
46
-        $this->listen(RouteEvent::MATCH, function (RouteEvent $event) {
46
+        $this->listen(RouteEvent::MATCH, function(RouteEvent $event) {
47 47
             $routeName = $event->getRouteMatch()->getMatchedRouteName();
48 48
             if (DefaultRoute::class === $routeName) {
49 49
                 $routeName = 'default';
50 50
             }
51 51
 
52 52
             $file = $event->getApp()->file();
53
-            $path = 'docs/' . $routeName . '.html';
53
+            $path = 'docs/'.$routeName.'.html';
54 54
 
55 55
             if ($file->has($path)) {
56 56
                 $docs = $file->read($path);
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
             }
59 59
         }, RouteEvent::FINISH);
60 60
 
61
-        $this->listen(RouteEvent::MATCH, function (RouteEvent $event) {
61
+        $this->listen(RouteEvent::MATCH, function(RouteEvent $event) {
62 62
             if (DefaultRoute::class !== $event->getRouteMatch()->getMatchedRouteName()) {
63 63
                 $event->setResponse($event->getApp()->url(DefaultRoute::class)->html('Go Home'));
64 64
             }
65 65
         }, RouteEvent::FINISH);
66 66
 
67
-        $this->listenRoute('myRoute', function (RouteEvent $event) {
67
+        $this->listenRoute('myRoute', function(RouteEvent $event) {
68 68
             $event->setResponse('<h1>My Route Example Content</h1>');
69 69
         });
70 70
 
71
-        $this->listenRoute('myRuntimeRoute', function (RouteEvent $event) {
71
+        $this->listenRoute('myRuntimeRoute', function(RouteEvent $event) {
72 72
             $event->setResponse([
73 73
                 '<h1>My Runtime Route Example Content</h1>',
74 74
             ]);
@@ -97,6 +97,6 @@  discard block
 block discarded – undo
97 97
 // runtime route example
98 98
 $app->route('myRuntimeRoute')->setLiteral('/my-runtime-route');
99 99
 
100
-require __DIR__ . '/dispatch.php';
100
+require __DIR__.'/dispatch.php';
101 101
 
102 102
 $app->dispatch();
Please login to merge, or discard this patch.
examples/simple/public/console-command/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 use WebinoExamplesLib\Html\ConsolePreview;
14 14
 use WebinoHtmlLib\Html;
15 15
 
16
-require __DIR__ . '/../../vendor/autoload.php';
16
+require __DIR__.'/../../vendor/autoload.php';
17 17
 
18 18
 /**
19 19
  * Custom console command class
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 $app = Webino::application($config)->bootstrap();
117 117
 
118
-$app->bind(DefaultRoute::class, function (RouteEvent $event) {
118
+$app->bind(DefaultRoute::class, function(RouteEvent $event) {
119 119
     $event->setResponse([
120 120
         new Html\Text('Use Command Line Interface!'),
121 121
         new ConsolePreview('preview.jpg'),
Please login to merge, or discard this patch.