Completed
Push — master ( 10f95b...bf15d4 )
by Michael
09:02
created

ApplicationServiceProvider   C

Complexity

Total Complexity 26

Size/Duplication

Total Lines 516
Duplicated Lines 20.16 %

Coupling/Cohesion

Components 0
Dependencies 27

Test Coverage

Coverage 99.3%

Importance

Changes 0
Metric Value
wmc 26
lcom 0
cbo 27
dl 104
loc 516
ccs 142
cts 143
cp 0.993
rs 5
c 0
b 0
f 0

25 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 56 1
A getAnalyticsService() 0 4 1
A getCacheClearCommandService() 9 9 1
A getCliApplicationService() 0 15 1
A getCliInputService() 0 4 1
A getCliOutputService() 0 4 1
A getColorProcessorService() 0 17 2
A getConsoleService() 0 7 1
A getDatabaseMigrateCommandService() 0 10 1
A getDatabaseStatusCommandService() 9 9 1
A getDisplayControllerGetService() 12 12 1
A getHelpCommandService() 9 9 1
A getInputCliService() 0 4 1
A getInputService() 0 4 1
A getInstallCommandService() 9 9 1
A getRouterService() 0 12 1
A getSnapshotCommandService() 9 9 1
A getStatsJsonViewService() 0 6 1
A getStatsModelService() 0 6 1
A getSubmitControllerCreateService() 11 11 1
A getSubmitControllerGetService() 9 9 1
A getTagsJoomlaCommandService() 9 9 1
A getTagsPhpCommandService() 9 9 1
A getUpdateCommandService() 9 9 1
A getWebApplicationService() 0 11 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * Joomla! Statistics Server
4
 *
5
 * @copyright  Copyright (C) 2013 - 2017 Open Source Matters, Inc. All rights reserved.
6
 * @license    http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License Version 2 or Later
7
 */
8
9
namespace Joomla\StatsServer\Providers;
10
11
use Joomla\Application as JoomlaApplication;
12
use Joomla\Database\DatabaseDriver;
13
use Joomla\DI\{
14
	Container, ServiceProviderInterface
15
};
16
use Joomla\Input\{
17
	Cli, Input
18
};
19
use Joomla\StatsServer\{
20
	CliApplication, Console, Router, WebApplication
21
};
22
use Joomla\StatsServer\Commands as AppCommands;
23
use Joomla\StatsServer\Controllers\{
24
	DisplayControllerGet, SubmitControllerCreate, SubmitControllerGet
25
};
26
use Joomla\StatsServer\Database\Migrations;
27
use Joomla\StatsServer\GitHub\GitHub;
28
use Joomla\StatsServer\Models\StatsModel;
29
use Joomla\StatsServer\Views\Stats\StatsJsonView;
30
use Psr\Cache\CacheItemPoolInterface;
31
use Psr\Log\LoggerInterface;
32
use TheIconic\Tracking\GoogleAnalytics\Analytics;
33
34
/**
35
 * Application service provider
36
 *
37
 * @since  1.0
38
 */
39
class ApplicationServiceProvider implements ServiceProviderInterface
40
{
41
	/**
42
	 * Registers the service provider with a DI container.
43
	 *
44
	 * @param   Container  $container  The DI container.
45
	 *
46
	 * @return  void
47
	 *
48
	 * @since   1.0
49
	 */
50 1
	public function register(Container $container)
51
	{
52
		/*
53
		 * Application Classes
54
		 */
55
56 1
		$container->alias(CliApplication::class, JoomlaApplication\AbstractCliApplication::class)
57 1
			->share(JoomlaApplication\AbstractCliApplication::class, [$this, 'getCliApplicationService'], true);
58
59 1
		$container->alias(WebApplication::class, JoomlaApplication\AbstractWebApplication::class)
60 1
			->share(JoomlaApplication\AbstractWebApplication::class, [$this, 'getWebApplicationService'], true);
61
62
		/*
63
		 * Application Class Dependencies
64
		 */
65
66 1
		$container->share(Analytics::class, [$this, 'getAnalyticsService'], true);
67 1
		$container->share(Cli::class, [$this, 'getInputCliService'], true);
68 1
		$container->share(Console::class, [$this, 'getConsoleService'], true);
69 1
		$container->share(Input::class, [$this, 'getInputService'], true);
70 1
		$container->share(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class, [$this, 'getColorProcessorService'], true);
71 1
		$container->share(JoomlaApplication\Cli\CliInput::class, [$this, 'getCliInputService'], true);
72 1
		$container->share(Router::class, [$this, 'getRouterService'], true);
73
74 1
		$container->alias(JoomlaApplication\Cli\CliOutput::class, JoomlaApplication\Cli\Output\Stdout::class)
75 1
			->share(JoomlaApplication\Cli\Output\Stdout::class, [$this, 'getCliOutputService'], true);
76
77
		/*
78
		 * Console Commands
79
		 */
80
81 1
		$container->share(AppCommands\Cache\ClearCommand::class, [$this, 'getCacheClearCommandService'], true);
82 1
		$container->share(AppCommands\HelpCommand::class, [$this, 'getHelpCommandService'], true);
83 1
		$container->share(AppCommands\InstallCommand::class, [$this, 'getInstallCommandService'], true);
84 1
		$container->share(AppCommands\Database\MigrateCommand::class, [$this, 'getDatabaseMigrateCommandService'], true);
85 1
		$container->share(AppCommands\Database\StatusCommand::class, [$this, 'getDatabaseStatusCommandService'], true);
86 1
		$container->share(AppCommands\SnapshotCommand::class, [$this, 'getSnapshotCommandService'], true);
87 1
		$container->share(AppCommands\Tags\JoomlaCommand::class, [$this, 'getTagsJoomlaCommandService'], true);
88 1
		$container->share(AppCommands\Tags\PhpCommand::class, [$this, 'getTagsPhpCommandService'], true);
89 1
		$container->share(AppCommands\UpdateCommand::class, [$this, 'getUpdateCommandService'], true);
90
91
		/*
92
		 * MVC Layer
93
		 */
94
95
		// Controllers
96 1
		$container->share(DisplayControllerGet::class, [$this, 'getDisplayControllerGetService'], true);
97 1
		$container->share(SubmitControllerCreate::class, [$this, 'getSubmitControllerCreateService'], true);
98 1
		$container->share(SubmitControllerGet::class, [$this, 'getSubmitControllerGetService'], true);
99
100
		// Models
101 1
		$container->share(StatsModel::class, [$this, 'getStatsModelService'], true);
102
103
		// Views
104 1
		$container->share(StatsJsonView::class, [$this, 'getStatsJsonViewService'], true);
105 1
	}
106
107
	/**
108
	 * Get the Analytics class service
109
	 *
110
	 * @param   Container  $container  The DI container.
111
	 *
112
	 * @return  Analytics
113
	 *
114
	 * @since   1.0
115
	 */
116 1
	public function getAnalyticsService(Container $container)
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
117
	{
118 1
		return new Analytics(true);
119
	}
120
121
	/**
122
	 * Get the Cache\ClearCommand class service
123
	 *
124
	 * @param   Container  $container  The DI container.
125
	 *
126
	 * @return  AppCommands\Cache\ClearCommand
127
	 *
128
	 * @since   1.0
129
	 */
130 1 View Code Duplication
	public function getCacheClearCommandService(Container $container) : AppCommands\Cache\ClearCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
131
	{
132 1
		$command = new AppCommands\Cache\ClearCommand($container->get(CacheItemPoolInterface::class));
133
134 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
135 1
		$command->setInput($container->get(Input::class));
136
137 1
		return $command;
138
	}
139
140
	/**
141
	 * Get the CLI application service
142
	 *
143
	 * @param   Container  $container  The DI container.
144
	 *
145
	 * @return  CliApplication
146
	 *
147
	 * @since   1.0
148
	 */
149 1
	public function getCliApplicationService(Container $container) : CliApplication
150
	{
151 1
		$application = new CliApplication(
152 1
			$container->get(Cli::class),
153 1
			$container->get('config'),
154 1
			$container->get(JoomlaApplication\Cli\CliOutput::class),
155 1
			$container->get(JoomlaApplication\Cli\CliInput::class),
156 1
			$container->get(Console::class)
157
		);
158
159
		// Inject extra services
160 1
		$application->setLogger($container->get('monolog.logger.cli'));
161
162 1
		return $application;
163
	}
164
165
	/**
166
	 * Get the CliInput class service
167
	 *
168
	 * @param   Container  $container  The DI container.
169
	 *
170
	 * @return  JoomlaApplication\Cli\CliInput
171
	 *
172
	 * @since   1.0
173
	 */
174 1
	public function getCliInputService(Container $container) : JoomlaApplication\Cli\CliInput
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
175
	{
176 1
		return new JoomlaApplication\Cli\CliInput;
177
	}
178
179
	/**
180
	 * Get the CliOutput class service
181
	 *
182
	 * @param   Container  $container  The DI container.
183
	 *
184
	 * @return  JoomlaApplication\Cli\CliOutput
185
	 *
186
	 * @since   1.0
187
	 */
188 1
	public function getCliOutputService(Container $container) : JoomlaApplication\Cli\Output\Stdout
189
	{
190 1
		return new JoomlaApplication\Cli\Output\Stdout($container->get(JoomlaApplication\Cli\Output\Processor\ColorProcessor::class));
191
	}
192
193
	/**
194
	 * Get the ColorProcessor class service
195
	 *
196
	 * @param   Container  $container  The DI container.
197
	 *
198
	 * @return  JoomlaApplication\Cli\Output\Processor\ColorProcessor
199
	 *
200
	 * @since   1.0
201
	 */
202 1
	public function getColorProcessorService(Container $container) : JoomlaApplication\Cli\Output\Processor\ColorProcessor
203
	{
204 1
		$processor = new JoomlaApplication\Cli\Output\Processor\ColorProcessor;
205
206
		/** @var Input $input */
207 1
		$input = $container->get(Cli::class);
208
209 1
		if ($input->getBool('nocolors', false))
210
		{
211
			$processor->noColors = true;
212
		}
213
214
		// Setup app colors (also required in "nocolors" mode - to strip them).
215 1
		$processor->addStyle('title', new JoomlaApplication\Cli\ColorStyle('yellow', '', ['bold']));
216
217 1
		return $processor;
218
	}
219
220
	/**
221
	 * Get the console service
222
	 *
223
	 * @param   Container  $container  The DI container.
224
	 *
225
	 * @return  Console
226
	 *
227
	 * @since   1.0
228
	 */
229 1
	public function getConsoleService(Container $container) : Console
230
	{
231 1
		$console = new Console;
232 1
		$console->setContainer($container);
233
234 1
		return $console;
235
	}
236
237
	/**
238
	 * Get the Database\MigrateCommand class service
239
	 *
240
	 * @param   Container  $container  The DI container.
241
	 *
242
	 * @return  AppCommands\Database\MigrateCommand
243
	 *
244
	 * @since   1.0
245
	 */
246 1
	public function getDatabaseMigrateCommandService(Container $container) : AppCommands\Database\MigrateCommand
247
	{
248 1
		$command = new AppCommands\Database\MigrateCommand($container->get(Migrations::class));
249
250 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
251 1
		$command->setInput($container->get(Input::class));
252 1
		$command->setLogger($container->get(LoggerInterface::class));
253
254 1
		return $command;
255
	}
256
257
	/**
258
	 * Get the Database\StatusCommand class service
259
	 *
260
	 * @param   Container  $container  The DI container.
261
	 *
262
	 * @return  AppCommands\Database\StatusCommand
263
	 *
264
	 * @since   1.0
265
	 */
266 1 View Code Duplication
	public function getDatabaseStatusCommandService(Container $container) : AppCommands\Database\StatusCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
267
	{
268 1
		$command = new AppCommands\Database\StatusCommand($container->get(Migrations::class));
269
270 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
271 1
		$command->setInput($container->get(Input::class));
272
273 1
		return $command;
274
	}
275
276
	/**
277
	 * Get the DisplayControllerGet class service
278
	 *
279
	 * @param   Container  $container  The DI container.
280
	 *
281
	 * @return  DisplayControllerGet
282
	 *
283
	 * @since   1.0
284
	 */
285 1 View Code Duplication
	public function getDisplayControllerGetService(Container $container) : DisplayControllerGet
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
286
	{
287 1
		$controller = new DisplayControllerGet(
288 1
			$container->get(StatsJsonView::class),
289 1
			$container->get(CacheItemPoolInterface::class)
290
		);
291
292 1
		$controller->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
293 1
		$controller->setInput($container->get(Input::class));
294
295 1
		return $controller;
296
	}
297
298
	/**
299
	 * Get the HelpCommand class service
300
	 *
301
	 * @param   Container  $container  The DI container.
302
	 *
303
	 * @return  AppCommands\HelpCommand
304
	 *
305
	 * @since   1.0
306
	 */
307 1 View Code Duplication
	public function getHelpCommandService(Container $container) : AppCommands\HelpCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
308
	{
309 1
		$command = new AppCommands\HelpCommand;
310
311 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
312 1
		$command->setInput($container->get(Input::class));
313
314 1
		return $command;
315
	}
316
317
	/**
318
	 * Get the Input\Cli class service
319
	 *
320
	 * @param   Container  $container  The DI container.
321
	 *
322
	 * @return  Cli
323
	 *
324
	 * @since   1.0
325
	 */
326 1
	public function getInputCliService(Container $container) : Cli
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
327
	{
328 1
		return new Cli;
329
	}
330
331
	/**
332
	 * Get the Input class service
333
	 *
334
	 * @param   Container  $container  The DI container.
335
	 *
336
	 * @return  Input
337
	 *
338
	 * @since   1.0
339
	 */
340 1
	public function getInputService(Container $container) : Input
0 ignored issues
show
Unused Code introduced by
The parameter $container is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
341
	{
342 1
		return new Input($_REQUEST);
343
	}
344
345
	/**
346
	 * Get the InstallCommand class service
347
	 *
348
	 * @param   Container  $container  The DI container.
349
	 *
350
	 * @return  AppCommands\InstallCommand
351
	 *
352
	 * @since   1.0
353
	 */
354 1 View Code Duplication
	public function getInstallCommandService(Container $container) : AppCommands\InstallCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
355
	{
356 1
		$command = new AppCommands\InstallCommand($container->get(DatabaseDriver::class));
357
358 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
359 1
		$command->setInput($container->get(Input::class));
360
361 1
		return $command;
362
	}
363
364
	/**
365
	 * Get the router service
366
	 *
367
	 * @param   Container  $container  The DI container.
368
	 *
369
	 * @return  Router
370
	 *
371
	 * @since   1.0
372
	 */
373 1
	public function getRouterService(Container $container) : Router
374
	{
375 1
		$router = (new Router($container->get(Input::class)))
376 1
			->setControllerPrefix('Joomla\\StatsServer\\Controllers\\')
377 1
			->setDefaultController('DisplayController')
378 1
			->addMap('/submit', 'SubmitController')
379 1
			->addMap('/:source', 'DisplayController');
380
381 1
		$router->setContainer($container);
382
383 1
		return $router;
384
	}
385
386
	/**
387
	 * Get the SnapshotCommand class service
388
	 *
389
	 * @param   Container  $container  The DI container.
390
	 *
391
	 * @return  AppCommands\SnapshotCommand
392
	 *
393
	 * @since   1.0
394
	 */
395 1 View Code Duplication
	public function getSnapshotCommandService(Container $container) : AppCommands\SnapshotCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
396
	{
397 1
		$command = new AppCommands\SnapshotCommand($container->get(StatsJsonView::class));
398
399 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
400 1
		$command->setInput($container->get(Input::class));
401
402 1
		return $command;
403
	}
404
405
	/**
406
	 * Get the StatsJsonView class service
407
	 *
408
	 * @param   Container  $container  The DI container.
409
	 *
410
	 * @return  StatsJsonView
411
	 *
412
	 * @since   1.0
413
	 */
414 1
	public function getStatsJsonViewService(Container $container) : StatsJsonView
415
	{
416 1
		return new StatsJsonView(
417 1
			$container->get(StatsModel::class)
418
		);
419
	}
420
421
	/**
422
	 * Get the StatsModel class service
423
	 *
424
	 * @param   Container  $container  The DI container.
425
	 *
426
	 * @return  StatsModel
427
	 *
428
	 * @since   1.0
429
	 */
430 1
	public function getStatsModelService(Container $container) : StatsModel
431
	{
432 1
		return new StatsModel(
433 1
			$container->get(DatabaseDriver::class)
434
		);
435
	}
436
437
	/**
438
	 * Get the SubmitControllerCreate class service
439
	 *
440
	 * @param   Container  $container  The DI container.
441
	 *
442
	 * @return  SubmitControllerCreate
443
	 *
444
	 * @since   1.0
445
	 */
446 1 View Code Duplication
	public function getSubmitControllerCreateService(Container $container) : SubmitControllerCreate
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
447
	{
448 1
		$controller = new SubmitControllerCreate(
449 1
			$container->get(StatsModel::class)
450
		);
451
452 1
		$controller->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
453 1
		$controller->setInput($container->get(Input::class));
454
455 1
		return $controller;
456
	}
457
458
	/**
459
	 * Get the SubmitControllerGet class service
460
	 *
461
	 * @param   Container  $container  The DI container.
462
	 *
463
	 * @return  SubmitControllerGet
464
	 *
465
	 * @since   1.0
466
	 */
467 1 View Code Duplication
	public function getSubmitControllerGetService(Container $container) : SubmitControllerGet
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
468
	{
469 1
		$controller = new SubmitControllerGet;
470
471 1
		$controller->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
472 1
		$controller->setInput($container->get(Input::class));
473
474 1
		return $controller;
475
	}
476
477
	/**
478
	 * Get the Tags\JoomlaCommand class service
479
	 *
480
	 * @param   Container  $container  The DI container.
481
	 *
482
	 * @return  AppCommands\Tags\JoomlaCommand
483
	 *
484
	 * @since   1.0
485
	 */
486 1 View Code Duplication
	public function getTagsJoomlaCommandService(Container $container) : AppCommands\Tags\JoomlaCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
487
	{
488 1
		$command = new AppCommands\Tags\JoomlaCommand($container->get(GitHub::class));
489
490 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
491 1
		$command->setInput($container->get(Input::class));
492
493 1
		return $command;
494
	}
495
496
	/**
497
	 * Get the Tags\PhpCommand class service
498
	 *
499
	 * @param   Container  $container  The DI container.
500
	 *
501
	 * @return  AppCommands\Tags\PhpCommand
502
	 *
503
	 * @since   1.0
504
	 */
505 1 View Code Duplication
	public function getTagsPhpCommandService(Container $container) : AppCommands\Tags\PhpCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
506
	{
507 1
		$command = new AppCommands\Tags\PhpCommand($container->get(GitHub::class));
508
509 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
510 1
		$command->setInput($container->get(Input::class));
511
512 1
		return $command;
513
	}
514
515
	/**
516
	 * Get the UpdateCommand class service
517
	 *
518
	 * @param   Container  $container  The DI container.
519
	 *
520
	 * @return  AppCommands\UpdateCommand
521
	 *
522
	 * @since   1.0
523
	 */
524 1 View Code Duplication
	public function getUpdateCommandService(Container $container) : AppCommands\UpdateCommand
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
525
	{
526 1
		$command = new AppCommands\UpdateCommand;
527
528 1
		$command->setApplication($container->get(JoomlaApplication\AbstractApplication::class));
529 1
		$command->setInput($container->get(Input::class));
530
531 1
		return $command;
532
	}
533
534
	/**
535
	 * Get the web application service
536
	 *
537
	 * @param   Container  $container  The DI container.
538
	 *
539
	 * @return  WebApplication
540
	 *
541
	 * @since   1.0
542
	 */
543 1
	public function getWebApplicationService(Container $container) : WebApplication
544
	{
545 1
		$application = new WebApplication($container->get(Input::class), $container->get('config'));
546
547
		// Inject extra services
548 1
		$application->setAnalytics($container->get(Analytics::class));
549 1
		$application->setLogger($container->get('monolog.logger.application'));
550 1
		$application->setRouter($container->get(Router::class));
551
552 1
		return $application;
553
	}
554
}
555