@@ -1,1 +1,1 @@ |
||
1 | -<?php require __DIR__ . '/../../../vendor/autoload.php'; |
|
1 | +<?php require __DIR__.'/../../../vendor/autoload.php'; |
@@ -26,15 +26,15 @@ discard block |
||
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->setResponseContent($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->setResponseContent($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->setResponseContent([ |
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 |
||
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 |
||
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->setResponseContent($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->setResponseContent('<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->setResponseContent([ |
73 | 73 | '<h1>My Runtime Route Example Content</h1>', |
74 | 74 | ]); |
@@ -97,6 +97,6 @@ discard block |
||
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(); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | use WebinoAppLib\Feature as AppFeature; |
8 | 8 | use WebinoConfigLib\Feature as ConfigFeature; |
9 | 9 | |
10 | -require __DIR__ . '/../src/MyCustomListener.php'; |
|
10 | +require __DIR__.'/../src/MyCustomListener.php'; |
|
11 | 11 | |
12 | 12 | return new CoreConfig([ |
13 | 13 | new ConfigFeature\Log, |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | public function init() |
12 | 12 | { |
13 | - $this->listen(\WebinoAppLib\Event\AppEvent::DISPATCH, function () { |
|
13 | + $this->listen(\WebinoAppLib\Event\AppEvent::DISPATCH, function() { |
|
14 | 14 | echo 'Webino Application Advanced Usage Example'; |
15 | 15 | }); |
16 | 16 | } |
@@ -1,1 +1,1 @@ |
||
1 | -<?php require __DIR__ . '/../service-invokable-config-override/index.php'; |
|
1 | +<?php require __DIR__.'/../service-invokable-config-override/index.php'; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use WebinoAppLib\Router\DefaultRoute; |
10 | 10 | use WebinoHtmlLib\Html; |
11 | 11 | |
12 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
12 | +require __DIR__.'/../../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | $debugger = Webino::debugger(Webino::debuggerOptions()->setDevMode()->setBar()); |
15 | 15 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $app->file()->write('my/folder/test-2.txt', null); |
21 | 21 | $app->file()->write('my/folder/folder-2/test-3.txt', null); |
22 | 22 | |
23 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
23 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
24 | 24 | /** |
25 | 25 | * Listing directory |
26 | 26 | * contents recursively. |
@@ -9,14 +9,14 @@ discard block |
||
9 | 9 | use WebinoAppLib\Router\DefaultRoute; |
10 | 10 | use WebinoHtmlLib\Html; |
11 | 11 | |
12 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
12 | +require __DIR__.'/../../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | $app = Webino::application()->bootstrap(); |
15 | 15 | |
16 | 16 | // setup |
17 | 17 | $app->file()->write('my/folder/test.txt', 'Test file contents.'); |
18 | 18 | |
19 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
19 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
20 | 20 | /** |
21 | 21 | * Obtaining file |
22 | 22 | * MIME type. |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | $size = $event->getApp()->file()->getSize('my/folder/test.txt'); |
37 | 37 | |
38 | 38 | $event->setResponseContent([ |
39 | - new Html\Text('MIME type: ' . $mimetype), |
|
40 | - new Html\Text('Timestamp: ' . $timestamp), |
|
41 | - new Html\Text('Size: ' . $size), |
|
39 | + new Html\Text('MIME type: '.$mimetype), |
|
40 | + new Html\Text('Timestamp: '.$timestamp), |
|
41 | + new Html\Text('Size: '.$size), |
|
42 | 42 | new SourcePreview(__FILE__), |
43 | 43 | ]); |
44 | 44 | }); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use WebinoAppLib\Response\Content\SourcePreview; |
10 | 10 | use WebinoAppLib\Router\DefaultRoute; |
11 | 11 | |
12 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
12 | +require __DIR__.'/../../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * Invokable service |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $app = Webino::application($config)->bootstrap(); |
39 | 39 | |
40 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
40 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
41 | 41 | /** |
42 | 42 | * Obtaining example |
43 | 43 | * service instance. |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use WebinoViewLib\Feature\NodeView; |
17 | 17 | use WebinoViewLib\Feature\ViewTemplateMap; |
18 | 18 | |
19 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
19 | +require __DIR__.'/../../vendor/autoload.php'; |
|
20 | 20 | |
21 | 21 | // TODO |
22 | 22 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | (new Route('viewTest'))->setLiteral('/view-test'), |
112 | 112 | |
113 | - new ViewTemplateMap(__DIR__ . '/view'), |
|
113 | + new ViewTemplateMap(__DIR__.'/view'), |
|
114 | 114 | |
115 | 115 | new CommonView([ |
116 | 116 | (new NodeView('content')) |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $app = Webino::application($config)->bootstrap(); |
125 | 125 | |
126 | -$app->bindRoute('viewTest', function (RouteEvent $event) { |
|
126 | +$app->bindRoute('viewTest', function(RouteEvent $event) { |
|
127 | 127 | /** |
128 | 128 | * Responding |
129 | 129 | * using view. |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $event->setResponse(new ViewResponse); |
132 | 132 | }); |
133 | 133 | |
134 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
134 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
135 | 135 | $event->setResponseContent([ |
136 | 136 | $event->getApp()->url('viewTest')->html('View response!'), |
137 | 137 | new SourcePreview(__FILE__), |