Completed
Branch new-addon-api (b7bde0)
by
unknown
18:29 queued 08:41
created

AddonApi   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 135
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 135
rs 10
c 0
b 0
f 0
wmc 11
lcom 2
cbo 3

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 1
A dataMigrationScripts() 0 4 1
A addDataMigrationScripts() 0 4 1
A entityClasses() 0 4 1
A addEntityClasses() 0 4 1
A entityModels() 0 4 1
A addEntityModels() 0 4 1
A entityClassExtensions() 0 4 1
A addEntityClassExtensions() 0 4 1
A entityModelExtensions() 0 4 1
A addEntityModelExtensions() 0 4 1
1
<?php
2
3
namespace EventEspresso\core\services\addon\api\v1;
4
5
use EventEspresso\core\services\addon\api\AddonApiVersion;
6
7
class AddonApi extends AddonApiVersion
8
{
9
10
    /**
11
     * @var DataMigrationApi
12
     */
13
    private $data_migration_api;
14
15
    /**
16
     * @var LegacyModelApi
17
     */
18
    private $legacy_model_api;
19
20
21
    /**
22
     * Bootstrap constructor.
23
     *
24
     * @param string $slug
25
     * @param string $name
26
     * @param string $namespace
27
     * @param string $version
28
     * @param string $min_core_version
29
     * @param string $main_file
30
     */
31
    public function __construct(
32
        string $slug,
33
        string $name,
34
        string $namespace,
35
        string $version,
36
        string $min_core_version,
37
        string $main_file
38
    ) {
39
        parent::__construct(
40
            $slug,
41
            $name,
42
            $namespace,
43
            $version,
44
            $min_core_version,
45
            $main_file,
46
            AddonApiVersion::V1
47
        );
48
        $this->legacy_model_api = new LegacyModelApi();
49
        $this->data_migration_api = new DataMigrationApi();
50
    }
51
52
53
    /**
54
     * @return string
55
     */
56
    public function dataMigrationScripts(): string
57
    {
58
        return $this->data_migration_api->dataMigrationScripts();
59
    }
60
61
62
    /**
63
     * @param string $data_migration_scripts
64
     */
65
    public function addDataMigrationScripts(string $data_migration_scripts): void
66
    {
67
        $this->data_migration_api->addDataMigrationScripts($data_migration_scripts);
68
    }
69
70
71
    /**
72
     * @return string
73
     */
74
    public function entityClasses(): string
75
    {
76
        return $this->legacy_model_api->entityClasses();
77
    }
78
79
80
    /**
81
     * @param string $entity_classes
82
     */
83
    public function addEntityClasses(string $entity_classes): void
84
    {
85
        $this->legacy_model_api->addEntityClasses($entity_classes);
86
    }
87
88
89
    /**
90
     * @return string
91
     */
92
    public function entityModels(): string
93
    {
94
        return $this->legacy_model_api->entityModels();
95
    }
96
97
98
    /**
99
     * @param string $entity_models
100
     */
101
    public function addEntityModels(string $entity_models): void
102
    {
103
        $this->legacy_model_api->addEntityModels($entity_models);
104
    }
105
106
107
    /**
108
     * @return string
109
     */
110
    public function entityClassExtensions(): string
111
    {
112
        return $this->legacy_model_api->entityClassExtensions();
113
    }
114
115
116
    /**
117
     * @param string $entity_class_extensions
118
     */
119
    public function addEntityClassExtensions(string $entity_class_extensions): void
120
    {
121
        $this->legacy_model_api->addEntityClassExtensions($entity_class_extensions);
122
    }
123
124
125
    /**
126
     * @return string
127
     */
128
    public function entityModelExtensions(): string
129
    {
130
        return $this->legacy_model_api->entityModelExtensions();
131
    }
132
133
134
    /**
135
     * @param string $entity_model_extensions
136
     */
137
    public function addEntityModelExtensions(string $entity_model_extensions): void
138
    {
139
        $this->legacy_model_api->addEntityModelExtensions($entity_model_extensions);
140
    }
141
}
142