@@ -18,6 +18,10 @@ Hawkbit\Application uses latest versions of [League\Route](https://github.com/th
1818
1919Hawkbit\Application is an advanced derivate of [ Proton] ( https://github.com/alexbilbie/Proton ) and part of Hawkbit\Application Component collection by Marco Bunge. Hawkbit\Application 1.x is also known as Blast Hawkbit\Application.
2020
21+ ### Quick start
22+
23+ Please see [ public/] ( public/ ) for example usage and read documentation.
24+
2125### Integrations
2226
2327Hawkbit\Application delivers also optional packages:
@@ -77,7 +81,7 @@ Create a new app
7781
7882require __DIR__.'/../vendor/autoload.php';
7983
80- $app = new \Hawkbit\Application\Application ();
84+ $app = new \Hawkbit\Application();
8185```
8286
8387Create a new app with configuration
@@ -88,15 +92,15 @@ Create a new app with configuration
8892$config = [
8993 'key' => 'value'
9094];
91- $app = new \Hawkbit\Application\Application ($config);
95+ $app = new \Hawkbit\Application($config);
9296```
9397
9498Add routes
9599
96100``` php
97101<?php
98102
99- /** @var Hawkbit\Application\Application $app */
103+ /** @var Hawkbit\Application $app */
100104$app->get('/', function ($request, $response) {
101105 $response->getBody()->write('<h1 >It works!</h1 >');
102106 return $response;
@@ -171,7 +175,7 @@ Hawkbit\Application middlewares allows advanced control of lifecycle execution.
171175$app->addMiddleware(new Acme\SomeMiddleware);
172176```
173177
174- Hawkbit\Application uses it's own runner ` Hawkbit\Application\Application\ MiddelwareRunner `
178+ Hawkbit\Application uses it's own runner ` Hawkbit\Application\MiddelwareRunner `
175179
176180## Routing
177181
@@ -225,7 +229,7 @@ Basic usage with controllers:
225229
226230require __DIR__.'/../vendor/autoload.php';
227231
228- $app = new Hawkbit\Application\Application ();
232+ $app = new Hawkbit\Application();
229233
230234$app->get('/', 'HomeController::index'); // calls index method on HomeController class
231235
@@ -259,7 +263,7 @@ Automatic constructor injection of controllers:
259263
260264require __DIR__.'/../vendor/autoload.php';
261265
262- $app = new Hawkbit\Application\Application ();
266+ $app = new Hawkbit\Application();
263267
264268$app->getContainer()->add('CustomService', new CustomService);
265269$app->get('/', 'HomeController::index'); // calls index method on HomeController class
@@ -332,7 +336,7 @@ $app->group('/admin', function (\League\Route\RouteGroup $route) {
332336#### Available vars
333337
334338- ` $route ` - ` \League\Route\RouteGroup `
335- - ` $this ` - ` \Hawkbit\Application\Application `
339+ - ` $this ` - ` \Hawkbit\Application `
336340
337341## Middleware integrations
338342
@@ -346,7 +350,7 @@ Basic usage with StackPHP (using `Stack\Builder` and `Stack\Run`):
346350// index.php
347351require __DIR__.'/../vendor/autoload.php';
348352
349- $app = new Hawkbit\Application\Application ();
353+ $app = new Hawkbit\Application();
350354
351355$app->get('/', function ($request, $response) {
352356 $response->setContent('<h1 >Hello World</h1 >');
@@ -373,7 +377,7 @@ Basic usage with Stratigility (using `Zend\Stratigility\MiddlewarePipe`):
373377
374378use Psr\Http\Message\ResponseInterface;
375379use Zend\Diactoros\ServerRequestFactory;
376- use Hawkbit\Application\Application ;
380+ use Hawkbit\Application;
377381use Hawkbit\Application\Stratigility\MiddlewarePipeAdapter;
378382
379383$application = new Application();
@@ -448,14 +452,14 @@ For more information about channels read this guide - [https://github.com/Seldae
448452## Events
449453
450454You can intercept requests and responses at seven points during the lifecycle. You can manipulate Request, Response and
451- ErrorResponse via ` Hawkbit\Application\ ApplicationEvent ` .
455+ ErrorResponse via ` Hawkbit\ApplicationEvent ` .
452456
453457### Application event
454458
455459``` php
456460<?php
457461
458- /** @var \Hawkbit\Application\Application\ ApplicationEvent $event */
462+ /** @var \Hawkbit\Application\ApplicationEvent $event */
459463
460464// custom params
461465$event->getParamCollection(); // returns a mutable \ArrayObject
@@ -470,7 +474,7 @@ $event->getApplication();
470474``` php
471475<?php
472476
473- $app->addListener($app::EVENT_REQUEST_RECEIVED, function (\Hawkbit\Application\Application\ ApplicationEvent $event) {
477+ $app->addListener($app::EVENT_REQUEST_RECEIVED, function (\Hawkbit\Application\ApplicationEvent $event) {
474478 $request = $event->getRequest();
475479
476480 // manipulate $request
@@ -488,7 +492,7 @@ This event is fired when a request is received but before it has been processed
488492``` php
489493<?php
490494
491- $app->addListener($app::EVENT_RESPONSE_CREATED, function (\Hawkbit\Application\Application\ ApplicationEvent $event) {
495+ $app->addListener($app::EVENT_RESPONSE_CREATED, function (\Hawkbit\Application\ApplicationEvent $event) {
492496 $request = $event->getRequest();
493497 $response = $event->getResponse();
494498
@@ -508,7 +512,7 @@ This event is fired when a response has been created but before it has been outp
508512``` php
509513<?php
510514
511- $app->addListener($app::EVENT_RESPONSE_SENT, function (\Hawkbit\Application\Application\ ApplicationEvent $event) {
515+ $app->addListener($app::EVENT_RESPONSE_SENT, function (\Hawkbit\Application\ApplicationEvent $event) {
512516 $request = $event->getRequest();
513517 $response = $event->getResponse();
514518
@@ -526,7 +530,7 @@ This event is fired when a response has been output and before the application l
526530``` php
527531<?php
528532
529- $app->addListener($app::EVENT_RUNTIME_ERROR, function (\Hawkbit\Application\Application\ ApplicationEvent $event, $exception) use ($app) {
533+ $app->addListener($app::EVENT_RUNTIME_ERROR, function (\Hawkbit\Application\ApplicationEvent $event, $exception) use ($app) {
530534 //process exception
531535});
532536```
@@ -542,7 +546,7 @@ This event is always fired when an error occurs.
542546``` php
543547<?php
544548
545- $app->addListener($app::EVENT_LIFECYCLE_ERROR, function (\Hawkbit\Application\Application\ ApplicationEvent $event, \Exception $exception) {
549+ $app->addListener($app::EVENT_LIFECYCLE_ERROR, function (\Hawkbit\Application\ApplicationEvent $event, \Exception $exception) {
546550 $errorResponse = $event->getErrorResponse();
547551
548552 //manipulate error response and process exception
@@ -561,7 +565,7 @@ This event is fired after runtime.error
561565``` php
562566<?php
563567
564- $app->addListener($app::EVENT_LIFECYCLE_COMPLETE, function (\Hawkbit\Application\Application\ ApplicationEvent $event) {
568+ $app->addListener($app::EVENT_LIFECYCLE_COMPLETE, function (\Hawkbit\Application\ApplicationEvent $event) {
565569 // access the request using $event->getRequest()
566570 // access the response using $event->getResponse()
567571});
@@ -574,7 +578,7 @@ This event is fired when a response has been output and before the application l
574578``` php
575579<?php
576580
577- $app->addListener($app::EVENT_SHUTDOWN, function (\Hawkbit\Application\Application\ ApplicationEvent $event, $response, $terminatedOutputBuffers = []) {
581+ $app->addListener($app::EVENT_SHUTDOWN, function (\Hawkbit\Application\ApplicationEvent $event, $response, $terminatedOutputBuffers = []) {
578582 // access the response using $event->getResponse()
579583 // access terminated output buffer contents
580584 // or force application exit()
@@ -612,7 +616,7 @@ You can bind singleton objects into the container from the main application obje
612616
613617``` php
614618<?php
615- /** @var Hawkbit\Application\Application $app */
619+ /** @var Hawkbit\Application $app */
616620$app['db'] = function () use($app) {
617621 $config = $app->getConfig('database');
618622 $manager = new Illuminate\Database\Capsule\Manager;
@@ -637,7 +641,7 @@ or by container access:
637641
638642``` php
639643<?php
640- /** @var Hawkbit\Application\Application $app */
644+ /** @var Hawkbit\Application $app */
641645$app->getContainer()->share('db', function () use($app) {
642646 $config = $app->getConfig('database');
643647 $manager = new Illuminate\Database\Capsule\Manager;
0 commit comments