Passed
Pull Request — develop (#906)
by Anh Nguyen
06:17
created

anonymous//extensions/components/com_redcore/admin/services/provider.php$0   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A provider.php$0 ➔ register() 0 10 1
1
<?php
2
3
defined('_JEXEC') or die;
4
5
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\Dispatcher\Co...patcherFactoryInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Joomla\CMS\Extension\ComponentInterface;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\Extension\ComponentInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Joomla\CMS\Extension\MVCComponent;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\Extension\MVCComponent was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\Extension\Ser...ponentDispatcherFactory was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\Extension\Service\Provider\MVCFactory was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
0 ignored issues
show
Bug introduced by
The type Joomla\CMS\MVC\Factory\MVCFactoryInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Joomla\DI\Container;
12
use Joomla\DI\ServiceProviderInterface;
13
14
return new class implements ServiceProviderInterface {
15
16
	/**
17
	 * @param   Container  $container
18
	 */
19
	public function register(Container $container): void {
20
		$container->registerServiceProvider(new MVCFactory('\\Redcore\\Component\\Redcore'));
21
		$container->registerServiceProvider(new ComponentDispatcherFactory('\\Redcore\\Component\\Redcore'));
22
		$container->set(
23
			ComponentInterface::class,
24
			function (Container $container) {
25
				$component = new MVCComponent($container->get(ComponentDispatcherFactoryInterface::class));
26
				$component->setMVCFactory($container->get(MVCFactoryInterface::class));
27
28
				return $component;
29
			}
30
		);
31
	}
32
};