ComponentsIntegrationService   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fixAllInAppScope() 0 15 3
1
<?php
2
namespace Mouf\Html\Utils\WebLibraryManager\Components;
3
4
use Mouf\Composer\ComposerService;
5
use Mouf\MoufManager;
6
use Mouf\Html\Utils\WebLibraryManager\ComponentInstaller\ComponentInstaller;
7
8
/**
9
 * This service is in charge of integrating the "components" JS/CSS packages notion
10
 * with the WebLibraryManager.
11
 * It offers features for mapping components (as defined in http://github.com/robloach/component-installer)
12
 * into WebLibraries. 
13
 * 
14
 * @author David Négrier
15
 */
16
class ComponentsIntegrationService {
17
	
18
	public static function fixAllInAppScope() {
19
		$composerService = new ComposerService();
20
		$packages = $composerService->getLocalPackagesOrderedByDependencies();
21
		
22
		$moufManager = MoufManager::getMoufManager();
23
		
24
		foreach ($packages as $package) {
25
			/* @var $package PackageInterface */
26
			if ($package->getType() != "component") {
27
				continue;
28
			}
29
				
30
			ComponentInstaller::installComponent($package, $composerService->getComposerConfig(), $moufManager);
31
		}
32
	}
33
}
34