1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\Providers;
12:
13: use Symfony\Component\Console\Application as ConsoleApplication;
14: use Autarky\Application;
15:
16: /**
17: * Abstract class for service providers.
18: *
19: * Service providers are modular application configuration classes. They can do
20: * anything from binding a service class onto the service container to add a
21: * bunch of routes with distinct functionality.
22: */
23: abstract class AbstractProvider implements ProviderInterface, ConsoleProviderInterface
24: {
25: /**
26: * The application instance.
27: *
28: * @var \Autarky\Application
29: */
30: protected $app;
31:
32: /**
33: * @param Application $app
34: */
35: public function setApplication(Application $app)
36: {
37: $this->app = $app;
38: }
39:
40: /**
41: * {@inheritdoc}
42: */
43: abstract public function register();
44:
45: /**
46: * {@inheritdoc}
47: */
48: public function registerConsole(ConsoleApplication $console) {}
49: }
50: