forked from akeneo/pim-community-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cd.php
126 lines (117 loc) · 4.45 KB
/
.php_cd.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
use Akeneo\CouplingDetector\Configuration\Configuration;
use Akeneo\CouplingDetector\Configuration\DefaultFinder;
use Akeneo\CouplingDetector\Domain\Rule;
use Akeneo\CouplingDetector\Domain\RuleInterface;
$finder = new DefaultFinder();
$finder->notPath('Oro');
$finder->notPath('Acme');
$finder->notPath('spec');
$finder->notPath('tests');
$cBusinessDeps = [
'Symfony\Component\Serializer',
'Symfony\Component\Validator',
'Symfony\Component\EventDispatcher',
'Symfony\Component\Security\Core', // for the moment, let's discuss about that later
];
$cUtilsDeps = [
'Symfony\Component\OptionsResolver',
'Symfony\Component\PropertyAccess',
'Symfony\Component\Filesystem',
'Symfony\Component\Yaml',
'Doctrine\Common\Collections',
'Doctrine\Common\Util\Inflector',
'Doctrine\Common\Util\ClassUtils',
'Doctrine\Common\Persistence\ObjectRepository',
'Akeneo\Tool\Component\StorageUtils',
];
$cDeps = array_merge($cBusinessDeps, $cUtilsDeps);
$cAkeneoRules = [
new Rule('Akeneo\Tool\Component\Analytics', $cDeps, RuleInterface::TYPE_ONLY),
new Rule('Akeneo\Tool\Component\Batch', array_merge($cDeps, [
'Symfony\Component\Console'
]),
RuleInterface::TYPE_ONLY),
new Rule('Akeneo\Tool\Component\Buffer', $cDeps, RuleInterface::TYPE_ONLY),
new Rule(
'Akeneo\Tool\Component\Classification',
array_merge($cDeps, [
'Gedmo\Tree\RepositoryInterface', // used as base tree library
]),
RuleInterface::TYPE_ONLY
),
new Rule(
'Akeneo\Tool\Component\Console',
array_merge($cDeps, [
'Symfony\Component\Process' // used in CommandLauncher
]),
RuleInterface::TYPE_ONLY,
'this component have no real existence, it should be merged into Batch'
),
new Rule(
'Akeneo\Tool\Component\FileStorage',
array_merge($cDeps, [
'League\Flysystem', // used as base file storage system
'Symfony\Component\HttpFoundation', // used to handle uploaded files & stream response
]),
RuleInterface::TYPE_ONLY
),
new Rule(
'Akeneo\Tool\Component\Localization',
array_merge($cDeps, [
'Symfony\Component\Translation', // to translate units of the metric attribute types
]),
RuleInterface::TYPE_ONLY
),
new Rule(
'Akeneo\Tool\Component\StorageUtils',
array_merge(
$cDeps,
//TODO: the file using those dependencies should be part of the bundle
['Doctrine\ORM\EntityManager', 'Doctrine\ORM\PersistentCollection']
),
RuleInterface::TYPE_ONLY
),
new Rule('Akeneo\Tool\Component\Versioning', $cDeps, RuleInterface::TYPE_ONLY),
];
$cPimRules = [
/*
new Rule(
'Pim\Component\Catalog',
array_merge($cDeps, [
'Akeneo\Tool\Component\Localization', // to localize product's data
'Akeneo\Tool\Component\FileStorage', // for product categories
'Akeneo\Tool\Component\Classification', // to handle product's media
'Akeneo\Tool\Component\Versioning', // for the history of all models
]),
RuleInterface::TYPE_ONLY
),
new Rule(
'Akeneo\Tool\Component\Connector',
array_merge($cDeps, [
'Box\Spout', // to import/export CSV and XLSX files
'Akeneo\Tool\Component\Batch', // used as base import/export system
'Akeneo\Tool\Component\Buffer', // to handle large files
'Akeneo\Tool\Component\FileStorage', // to import/export product's media
'Akeneo\Tool\Component\Localization', // to use date and number formats in configuration
'Akeneo\Tool\Component\Classification', // to handle categories database reading
'Pim\Component\Catalog', // because ;)
'Pim\Component\Localization', // to check the localized data during an import
]),
RuleInterface::TYPE_ONLY
),
*/
new Rule(
'Pim\Component\ReferenceData',
array_merge($cDeps, [
'Pim\Component\Catalog',
'Akeneo\Pim\Enrichment\Component\Product',
'Akeneo\Pim\Structure\Component'
]),
RuleInterface::TYPE_ONLY
),
// new Rule('Akeneo\UserManagement\Component', $cDeps, RuleInterface::TYPE_ONLY),
];
$rules = array_merge($cAkeneoRules, $cPimRules);
$config = new Configuration($rules, $finder);
return $config;