| 1 | <?php |
||
| 19 | abstract class AbstractApplication implements ApplicationInterface |
||
| 20 | { |
||
| 21 | /** @var DependencyInjectionAdapterInterface */ |
||
| 22 | private $container; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * ApplicationInterface constructor. |
||
| 26 | * |
||
| 27 | * @param DependencyInjectionAdapterInterface $container |
||
| 28 | */ |
||
| 29 | 5 | public function __construct(DependencyInjectionAdapterInterface $container) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Returns the DI Adapter instance. |
||
| 36 | * |
||
| 37 | * @return DependencyInjectionAdapterInterface |
||
| 38 | */ |
||
| 39 | 5 | final public function getContainer() |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Runs the application. This is where the magic happens. |
||
| 46 | * For example for a web application this initializes the Request and Response objects, builds the middleware |
||
| 47 | * pipeline, applies the Routing and the Dispatch. |
||
| 48 | * |
||
| 49 | * @return void |
||
| 50 | */ |
||
| 51 | abstract public function run(); |
||
| 52 | } |
||
| 53 |