@@ -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 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | use WebinoHtmlLib\Html; |
| 12 | 12 | use WebinoConfigLib\Feature\Log; |
| 13 | 13 | |
| 14 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
| 14 | +require __DIR__.'/../../vendor/autoload.php'; |
|
| 15 | 15 | |
| 16 | 16 | $config = Webino::config([ |
| 17 | 17 | /** |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $app->log()->alert('Test alert log message!'); |
| 35 | 35 | $app->log()->emergency('Test emergency log message!'); |
| 36 | 36 | |
| 37 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
| 37 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
| 38 | 38 | /** |
| 39 | 39 | * Obtaining log |
| 40 | 40 | * file contents. |
@@ -1,1 +1,1 @@ |
||
| 1 | -<?php require __DIR__ . '/../service-invokable-config-override/index.php'; |
|
| 1 | +<?php require __DIR__.'/../service-invokable-config-override/index.php'; |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | use WebinoAppLib\Router\DefaultRoute; |
| 13 | 13 | use Zend\ServiceManager\ServiceLocatorInterface; |
| 14 | 14 | |
| 15 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
| 15 | +require __DIR__.'/../../vendor/autoload.php'; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Custom service |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | * Registering service |
| 36 | 36 | * via closure factory. |
| 37 | 37 | */ |
| 38 | -$app->set(MyService::class, function (ServiceLocatorInterface $services) { |
|
| 38 | +$app->set(MyService::class, function(ServiceLocatorInterface $services) { |
|
| 39 | 39 | $someDependency = 'example'; |
| 40 | 40 | return new MyService($someDependency); |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
| 43 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
| 44 | 44 | /** |
| 45 | 45 | * Obtaining service |
| 46 | 46 | * instance. |
@@ -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 | }); |