Completed
Push — master ( 080764...892a3f )
by Fabien
52:24
created
Classes/Grid/GridAnalyserService.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -16,114 +16,114 @@
 block discarded – undo
16 16
 class GridAnalyserService
17 17
 {
18 18
 
19
-    /**
20
-     * Check relation for table.
21
-     *
22
-     * @param $tableName
23
-     * @return array
24
-     */
25
-    public function checkRelationForTable($tableName)
26
-    {
19
+	/**
20
+	 * Check relation for table.
21
+	 *
22
+	 * @param $tableName
23
+	 * @return array
24
+	 */
25
+	public function checkRelationForTable($tableName)
26
+	{
27 27
 
28
-        $relations = [];
29
-        $table = Tca::table($tableName);
28
+		$relations = [];
29
+		$table = Tca::table($tableName);
30 30
 
31
-        $missingOppositionRelationMessage = <<<EOF
31
+		$missingOppositionRelationMessage = <<<EOF
32 32
 
33 33
   WARNING! Could not define relation precisely. This is not necessarily a problem
34 34
   if the opposite relation is not required in a Grid. But consider adding the opposite
35 35
   TCA configuration if so.
36 36
 EOF;
37 37
 
38
-        foreach (Tca::grid($tableName)->getFields() as $fieldName => $configuration) {
39
-
40
-            if ($table->hasField($fieldName)) {
41
-                if ($table->field($fieldName)->hasMany()) {
42
-                    if ($table->field($fieldName)->hasRelationWithCommaSeparatedValues()) {
43
-                        $_relations = $this->checkRelationOf($tableName, $fieldName, 'comma separated values');
44
-                        $relations = array_merge($relations, $_relations);
45
-                    } elseif ($table->field($fieldName)->hasRelationManyToMany()) {
46
-                        $_relations = $this->checkRelationManyToMany($tableName, $fieldName);
47
-                        $relations = array_merge($relations, $_relations);
48
-
49
-                    } elseif ($table->field($fieldName)->hasRelationOneToMany()) {
50
-                        $_relations = $this->checkRelationOf($tableName, $fieldName, 'one-to-many');
51
-                        $relations = array_merge($relations, $_relations);
52
-                    } else {
53
-                        $relations[] = sprintf('* field: "%s", relation: ?-to-many%s', $fieldName, $missingOppositionRelationMessage);
54
-                    }
55
-                    $relations[] = '';
56
-                } elseif ($table->field($fieldName)->hasOne()) {
57
-
58
-                    if ($table->field($fieldName)->hasRelationOneToOne()) {
59
-                        $relations[] = sprintf('* one-to-one "%s"', $fieldName);
60
-                    } elseif ($table->field($fieldName)->hasRelationManyToOne()) {
61
-                        $_relations = $this->checkRelationOf($tableName, $fieldName, 'many-to-one');
62
-                        $relations = array_merge($relations, $_relations);
63
-                    } else {
64
-                        $relations[] = sprintf('* field: "%s", relation: ?-to-one%s', $fieldName, $missingOppositionRelationMessage);
65
-                    }
66
-                    $relations[] = '';
67
-                }
68
-            }
69
-        }
70
-        return $relations;
71
-    }
72
-
73
-    /**
74
-     * Convenience method for printing out relation many-to-many.
75
-     *
76
-     * @param string $tableName
77
-     * @param string $fieldName
78
-     * @return array
79
-     */
80
-    protected function checkRelationManyToMany($tableName, $fieldName)
81
-    {
82
-
83
-        $output = [];
84
-
85
-        $table = Tca::table($tableName);
86
-        $output[] = sprintf('* field: "%s", relation: many-to-many', $fieldName);
87
-
88
-        $foreignTable = $table->field($fieldName)->getForeignTable();
89
-        $manyToManyTable = $table->field($fieldName)->getManyToManyTable();
90
-        $foreignField = $table->field($fieldName)->getForeignField();
91
-
92
-        if (!$foreignField) {
93
-            $output[] = sprintf('  ERROR! Can not found foreign field for "%s". Perhaps missing opposite configuration?', $fieldName);
94
-        } elseif (!$foreignTable) {
95
-            $output[] = sprintf('  ERROR! Can not found foreign table for "%s". Perhaps missing opposite configuration?', $fieldName);
96
-        } elseif (!$manyToManyTable) {
97
-            $output[] = sprintf('  ERROR! Can not found relation table (MM) for "%s". Perhaps missing opposite configuration?', $fieldName);
98
-        } else {
99
-            $output[] = sprintf('  %s.%s <--> %s <--> %s.%s', $tableName, $fieldName, $manyToManyTable, $foreignTable, $foreignField);
100
-        }
101
-
102
-        $output[] = '';
103
-        return $output;
104
-    }
105
-
106
-    /**
107
-     * Convenience method for printing out relation.
108
-     *
109
-     * @param string $tableName
110
-     * @param string $fieldName
111
-     * @param string $relationType
112
-     * @return array
113
-     */
114
-    protected function checkRelationOf($tableName, $fieldName, $relationType)
115
-    {
116
-
117
-        $output = [];
118
-
119
-        $table = Tca::table($tableName);
120
-        $output[] = sprintf('* field: "%s", relation: %s', $fieldName, $relationType);
121
-
122
-        $foreignTable = $table->field($fieldName)->getForeignTable();
123
-        $foreignField = $table->field($fieldName)->getForeignField();
124
-        $output[] = sprintf('  %s.%s <--> %s.%s', $tableName, $fieldName, $foreignTable, $foreignField);
125
-        $output[] = '';
126
-
127
-        return $output;
128
-    }
38
+		foreach (Tca::grid($tableName)->getFields() as $fieldName => $configuration) {
39
+
40
+			if ($table->hasField($fieldName)) {
41
+				if ($table->field($fieldName)->hasMany()) {
42
+					if ($table->field($fieldName)->hasRelationWithCommaSeparatedValues()) {
43
+						$_relations = $this->checkRelationOf($tableName, $fieldName, 'comma separated values');
44
+						$relations = array_merge($relations, $_relations);
45
+					} elseif ($table->field($fieldName)->hasRelationManyToMany()) {
46
+						$_relations = $this->checkRelationManyToMany($tableName, $fieldName);
47
+						$relations = array_merge($relations, $_relations);
48
+
49
+					} elseif ($table->field($fieldName)->hasRelationOneToMany()) {
50
+						$_relations = $this->checkRelationOf($tableName, $fieldName, 'one-to-many');
51
+						$relations = array_merge($relations, $_relations);
52
+					} else {
53
+						$relations[] = sprintf('* field: "%s", relation: ?-to-many%s', $fieldName, $missingOppositionRelationMessage);
54
+					}
55
+					$relations[] = '';
56
+				} elseif ($table->field($fieldName)->hasOne()) {
57
+
58
+					if ($table->field($fieldName)->hasRelationOneToOne()) {
59
+						$relations[] = sprintf('* one-to-one "%s"', $fieldName);
60
+					} elseif ($table->field($fieldName)->hasRelationManyToOne()) {
61
+						$_relations = $this->checkRelationOf($tableName, $fieldName, 'many-to-one');
62
+						$relations = array_merge($relations, $_relations);
63
+					} else {
64
+						$relations[] = sprintf('* field: "%s", relation: ?-to-one%s', $fieldName, $missingOppositionRelationMessage);
65
+					}
66
+					$relations[] = '';
67
+				}
68
+			}
69
+		}
70
+		return $relations;
71
+	}
72
+
73
+	/**
74
+	 * Convenience method for printing out relation many-to-many.
75
+	 *
76
+	 * @param string $tableName
77
+	 * @param string $fieldName
78
+	 * @return array
79
+	 */
80
+	protected function checkRelationManyToMany($tableName, $fieldName)
81
+	{
82
+
83
+		$output = [];
84
+
85
+		$table = Tca::table($tableName);
86
+		$output[] = sprintf('* field: "%s", relation: many-to-many', $fieldName);
87
+
88
+		$foreignTable = $table->field($fieldName)->getForeignTable();
89
+		$manyToManyTable = $table->field($fieldName)->getManyToManyTable();
90
+		$foreignField = $table->field($fieldName)->getForeignField();
91
+
92
+		if (!$foreignField) {
93
+			$output[] = sprintf('  ERROR! Can not found foreign field for "%s". Perhaps missing opposite configuration?', $fieldName);
94
+		} elseif (!$foreignTable) {
95
+			$output[] = sprintf('  ERROR! Can not found foreign table for "%s". Perhaps missing opposite configuration?', $fieldName);
96
+		} elseif (!$manyToManyTable) {
97
+			$output[] = sprintf('  ERROR! Can not found relation table (MM) for "%s". Perhaps missing opposite configuration?', $fieldName);
98
+		} else {
99
+			$output[] = sprintf('  %s.%s <--> %s <--> %s.%s', $tableName, $fieldName, $manyToManyTable, $foreignTable, $foreignField);
100
+		}
101
+
102
+		$output[] = '';
103
+		return $output;
104
+	}
105
+
106
+	/**
107
+	 * Convenience method for printing out relation.
108
+	 *
109
+	 * @param string $tableName
110
+	 * @param string $fieldName
111
+	 * @param string $relationType
112
+	 * @return array
113
+	 */
114
+	protected function checkRelationOf($tableName, $fieldName, $relationType)
115
+	{
116
+
117
+		$output = [];
118
+
119
+		$table = Tca::table($tableName);
120
+		$output[] = sprintf('* field: "%s", relation: %s', $fieldName, $relationType);
121
+
122
+		$foreignTable = $table->field($fieldName)->getForeignTable();
123
+		$foreignField = $table->field($fieldName)->getForeignField();
124
+		$output[] = sprintf('  %s.%s <--> %s.%s', $tableName, $fieldName, $foreignTable, $foreignField);
125
+		$output[] = '';
126
+
127
+		return $output;
128
+	}
129 129
 }
Please login to merge, or discard this patch.
Classes/Grid/CheckBoxRenderer.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -14,30 +14,30 @@
 block discarded – undo
14 14
 class CheckBoxRenderer extends ColumnRendererAbstract
15 15
 {
16 16
 
17
-    /**
18
-     * Configure the "Check Box" Grid Renderer.
19
-     */
20
-    public function __construct()
21
-    {
22
-        $configuration = array(
23
-            'width' => '5px',
24
-            'sortable' => false,
25
-            'canBeHidden' => false,
26
-            'html' => '<input type="checkbox" class="checkbox-row-top"/>',
27
-        );
28
-        parent::__construct($configuration);
29
-    }
17
+	/**
18
+	 * Configure the "Check Box" Grid Renderer.
19
+	 */
20
+	public function __construct()
21
+	{
22
+		$configuration = array(
23
+			'width' => '5px',
24
+			'sortable' => false,
25
+			'canBeHidden' => false,
26
+			'html' => '<input type="checkbox" class="checkbox-row-top"/>',
27
+		);
28
+		parent::__construct($configuration);
29
+	}
30 30
 
31
-    /**
32
-     * Render the "Check Box" in the Grid.
33
-     *
34
-     * @return string
35
-     */
36
-    public function render()
37
-    {
38
-        return sprintf('<input type="checkbox" class="checkbox-row" data-index="%s" data-uid="%s"/>',
39
-            $this->getRowIndex(),
40
-            $this->getObject()->getUid()
41
-        );
42
-    }
31
+	/**
32
+	 * Render the "Check Box" in the Grid.
33
+	 *
34
+	 * @return string
35
+	 */
36
+	public function render()
37
+	{
38
+		return sprintf('<input type="checkbox" class="checkbox-row" data-index="%s" data-uid="%s"/>',
39
+			$this->getRowIndex(),
40
+			$this->getObject()->getUid()
41
+		);
42
+	}
43 43
 }
Please login to merge, or discard this patch.
Classes/Grid/ButtonGroupRenderer.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -16,42 +16,42 @@
 block discarded – undo
16 16
 class ButtonGroupRenderer extends ColumnRendererAbstract
17 17
 {
18 18
 
19
-    /**
20
-     * Configure the "Button Group" Grid Renderer.
21
-     */
22
-    public function __construct()
23
-    {
24
-        $configuration = array(
25
-            'sortable' => false,
26
-            'canBeHidden' => false,
27
-            'width' => '100px',
28
-        );
29
-        parent::__construct($configuration);
30
-    }
31
-
32
-    /**
33
-     * Render the "Button Group" in the Grid, e.g. edit, delete, etc..
34
-     *
35
-     * @return string
36
-     */
37
-    public function render()
38
-    {
39
-        $components = $this->getModuleLoader()->getGridButtonsComponents();
40
-
41
-        $buttons = [];
42
-        foreach ($components as $component) {
43
-
44
-            /** @var  $view */
45
-            $view = GeneralUtility::makeInstance($component);
46
-            $buttons[] = $view->render($this->getObject());
47
-        }
48
-
49
-        $output = sprintf(
50
-            '<div class="btn-toolbar pull-right" role="toolbar" aria-label=""><div class="btn-group" role="group" aria-label="">%s</div></div>',
51
-            implode("\n", $buttons)
52
-        );
53
-
54
-        return $output;
55
-    }
19
+	/**
20
+	 * Configure the "Button Group" Grid Renderer.
21
+	 */
22
+	public function __construct()
23
+	{
24
+		$configuration = array(
25
+			'sortable' => false,
26
+			'canBeHidden' => false,
27
+			'width' => '100px',
28
+		);
29
+		parent::__construct($configuration);
30
+	}
31
+
32
+	/**
33
+	 * Render the "Button Group" in the Grid, e.g. edit, delete, etc..
34
+	 *
35
+	 * @return string
36
+	 */
37
+	public function render()
38
+	{
39
+		$components = $this->getModuleLoader()->getGridButtonsComponents();
40
+
41
+		$buttons = [];
42
+		foreach ($components as $component) {
43
+
44
+			/** @var  $view */
45
+			$view = GeneralUtility::makeInstance($component);
46
+			$buttons[] = $view->render($this->getObject());
47
+		}
48
+
49
+		$output = sprintf(
50
+			'<div class="btn-toolbar pull-right" role="toolbar" aria-label=""><div class="btn-group" role="group" aria-label="">%s</div></div>',
51
+			implode("\n", $buttons)
52
+		);
53
+
54
+		return $output;
55
+	}
56 56
 
57 57
 }
Please login to merge, or discard this patch.
Classes/Module/ConfigurablePart.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@
 block discarded – undo
14 14
 class ConfigurablePart
15 15
 {
16 16
 
17
-    const __default = '';
18
-    const EXCLUDED_FIELDS = 'excluded_fields';
19
-    const MENU_VISIBLE_ITEMS = 'menuVisibleItems';
20
-    const MENU_VISIBLE_ITEMS_DEFAULT = 'menuVisibleItemsDefault';
17
+	const __default = '';
18
+	const EXCLUDED_FIELDS = 'excluded_fields';
19
+	const MENU_VISIBLE_ITEMS = 'menuVisibleItems';
20
+	const MENU_VISIBLE_ITEMS_DEFAULT = 'menuVisibleItemsDefault';
21 21
 
22
-    /**
23
-     * Get the valid values for this enum.
24
-     *
25
-     * @param boolean $include_default
26
-     * @return array
27
-     */
28
-    static public function getParts($include_default = false)
29
-    {
22
+	/**
23
+	 * Get the valid values for this enum.
24
+	 *
25
+	 * @param boolean $include_default
26
+	 * @return array
27
+	 */
28
+	static public function getParts($include_default = false)
29
+	{
30 30
 
31
-        return array(
32
-            'EXCLUDED_FIELDS' => self::EXCLUDED_FIELDS,
33
-            'MENU_VISIBLE_ITEMS' => self::MENU_VISIBLE_ITEMS,
34
-            'MENU_VISIBLE_ITEMS_DEFAULT' => self::MENU_VISIBLE_ITEMS_DEFAULT,
35
-        );
36
-    }
31
+		return array(
32
+			'EXCLUDED_FIELDS' => self::EXCLUDED_FIELDS,
33
+			'MENU_VISIBLE_ITEMS' => self::MENU_VISIBLE_ITEMS,
34
+			'MENU_VISIBLE_ITEMS_DEFAULT' => self::MENU_VISIBLE_ITEMS_DEFAULT,
35
+		);
36
+	}
37 37
 
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
Classes/Persistence/ConstraintContainer.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -15,27 +15,27 @@
 block discarded – undo
15 15
  */
16 16
 class ConstraintContainer
17 17
 {
18
-    /**
19
-     * @var ConstraintInterface
20
-     */
21
-    protected $constraint;
18
+	/**
19
+	 * @var ConstraintInterface
20
+	 */
21
+	protected $constraint;
22 22
 
23
-    /**
24
-     * @return ConstraintInterface
25
-     */
26
-    public function getConstraint()
27
-    {
28
-        return $this->constraint;
29
-    }
23
+	/**
24
+	 * @return ConstraintInterface
25
+	 */
26
+	public function getConstraint()
27
+	{
28
+		return $this->constraint;
29
+	}
30 30
 
31
-    /**
32
-     * @param ConstraintInterface $constraint
33
-     * @return $this
34
-     */
35
-    public function setConstraint($constraint)
36
-    {
37
-        $this->constraint = $constraint;
38
-        return $this;
39
-    }
31
+	/**
32
+	 * @param ConstraintInterface $constraint
33
+	 * @return $this
34
+	 */
35
+	public function setConstraint($constraint)
36
+	{
37
+		$this->constraint = $constraint;
38
+		return $this;
39
+	}
40 40
 
41 41
 }
Please login to merge, or discard this patch.
Classes/Module/ModulePreferences.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -179,8 +179,8 @@
 block discarded – undo
179 179
         $generalSettings = $this->getSettings();
180 180
 
181 181
         $preferences = [];
182
-        if (isset($generalSettings[$dataType . '.'])) {
183
-            $settings = $generalSettings[$dataType . '.'];
182
+        if (isset($generalSettings[$dataType.'.'])) {
183
+            $settings = $generalSettings[$dataType.'.'];
184 184
 
185 185
             $configurableParts = ConfigurablePart::getParts();
186 186
             foreach ($settings as $key => $value) {
Please login to merge, or discard this patch.
Indentation   +216 added lines, -216 removed lines patch added patch discarded remove patch
@@ -19,221 +19,221 @@
 block discarded – undo
19 19
 class ModulePreferences implements SingletonInterface
20 20
 {
21 21
 
22
-    /**
23
-     * @var array
24
-     */
25
-    protected $preferences;
26
-
27
-    /**
28
-     * @var string
29
-     */
30
-    protected $tableName = 'tx_vidi_preference';
31
-
32
-    /**
33
-     * @param string $key
34
-     * @param string $dataType
35
-     * @return mixed
36
-     */
37
-    public function get($key, $dataType = '')
38
-    {
39
-
40
-        if (empty($dataType)) {
41
-            $dataType = $this->getModuleLoader()->getDataType();
42
-        }
43
-
44
-        if (!$this->isLoaded($dataType)) {
45
-            $this->load($dataType);
46
-        }
47
-
48
-        $value = empty($this->preferences[$dataType][$key]) ? null : $this->preferences[$dataType][$key];
49
-        return $value;
50
-    }
51
-
52
-    /**
53
-     * Tell whether the module is loaded.
54
-     *
55
-     * @param string $dataType
56
-     * @return bool
57
-     */
58
-    public function isLoaded($dataType)
59
-    {
60
-        return !empty($this->preferences[$dataType]);
61
-    }
62
-
63
-    /**
64
-     * @param string $dataType
65
-     * @return array
66
-     */
67
-    public function getAll($dataType = '')
68
-    {
69
-
70
-        if (empty($dataType)) {
71
-            $dataType = $this->getModuleLoader()->getDataType();
72
-        }
73
-        $this->load($dataType);
74
-        return $this->preferences[$dataType];
75
-    }
76
-
77
-    /**
78
-     * Get the md5 signature of the preferences.
79
-     *
80
-     * @param string $dataType
81
-     * @return bool
82
-     */
83
-    public function getSignature($dataType = '')
84
-    {
85
-        $preferences = $this->getAll($dataType);
86
-        return md5(serialize($preferences));
87
-    }
88
-
89
-    /**
90
-     * Load preferences.
91
-     *
92
-     * @param string $dataType
93
-     * @return void
94
-     */
95
-    public function load($dataType)
96
-    {
97
-
98
-        // Fetch preferences from different sources and overlay them
99
-        $databasePreferences = $this->fetchPreferencesFromDatabase($dataType);
100
-        $generalPreferences = $this->fetchGlobalPreferencesFromTypoScript();
101
-        $specificPreferences = $this->fetchExtraPreferencesFromTypoScript($dataType);
102
-
103
-        $preferences = array_merge($generalPreferences, $specificPreferences, $databasePreferences);
104
-        $this->preferences[$dataType] = $preferences;
105
-    }
106
-
107
-    /**
108
-     * Save preferences
109
-     *
110
-     * @param array $preferences
111
-     * @return void
112
-     */
113
-    public function save($preferences)
114
-    {
115
-        $configurableParts = ConfigurablePart::getParts();
116
-
117
-        $dataType = $this->getModuleLoader()->getDataType();
118
-        $this->getDataService()->delete(
119
-            $this->tableName,
120
-            [
121
-                'data_type' => $dataType
122
-            ]
123
-        );
124
-
125
-        $sanitizedPreferences = [];
126
-        foreach ($preferences as $key => $value) {
127
-            if (in_array($key, $configurableParts)) {
128
-                $sanitizedPreferences[$key] = $value;
129
-            }
130
-        }
131
-
132
-        $this->getDataService()->insert(
133
-            $this->tableName,
134
-            [
135
-                'data_type' => $dataType,
136
-                'preferences' => serialize($sanitizedPreferences),
137
-            ]
138
-        );
139
-    }
140
-
141
-    /**
142
-     * @param $dataType
143
-     * @return array
144
-     */
145
-    public function fetchPreferencesFromDatabase($dataType)
146
-    {
147
-        $preferences = [];
148
-        $record = $this->getDataService()->getRecord(
149
-            $this->tableName,
150
-            [
151
-                'data_type' => $dataType
152
-            ]
153
-        );
154
-
155
-        if (!empty($record)) {
156
-            $preferences = unserialize($record['preferences']);
157
-        }
158
-
159
-        return $preferences;
160
-    }
161
-
162
-    /**
163
-     * Returns the module settings.
164
-     *
165
-     * @return array
166
-     */
167
-    protected function fetchGlobalPreferencesFromTypoScript()
168
-    {
169
-        $settings = $this->getSettings();
170
-
171
-        $configurableParts = ConfigurablePart::getParts();
172
-        $preferences = [];
173
-        foreach ($settings as $key => $value) {
174
-            if (in_array($key, $configurableParts)) {
175
-                $preferences[$key] = $value;
176
-            }
177
-        }
178
-
179
-        return $preferences;
180
-    }
181
-
182
-    /**
183
-     * Returns the module settings.
184
-     *
185
-     * @param string $dataType
186
-     * @return array
187
-     */
188
-    protected function fetchExtraPreferencesFromTypoScript($dataType)
189
-    {
190
-        $generalSettings = $this->getSettings();
191
-
192
-        $preferences = [];
193
-        if (isset($generalSettings[$dataType . '.'])) {
194
-            $settings = $generalSettings[$dataType . '.'];
195
-
196
-            $configurableParts = ConfigurablePart::getParts();
197
-            foreach ($settings as $key => $value) {
198
-                if (in_array($key, $configurableParts)) {
199
-                    $preferences[$key] = $value;
200
-                }
201
-            }
202
-        }
203
-
204
-        return $preferences;
205
-    }
206
-
207
-    /**
208
-     * Returns the module settings.
209
-     *
210
-     * @return array
211
-     */
212
-    protected function getSettings()
213
-    {
214
-        /** @var BackendConfigurationManager $backendConfigurationManager */
215
-        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
216
-        $backendConfigurationManager = $objectManager->get(BackendConfigurationManager::class);
217
-        $configuration = $backendConfigurationManager->getTypoScriptSetup();
218
-        return $configuration['module.']['tx_vidi.']['settings.'];
219
-    }
220
-
221
-    /**
222
-     * @return object|DataService
223
-     */
224
-    protected function getDataService(): DataService
225
-    {
226
-        return GeneralUtility::makeInstance(DataService::class);
227
-    }
228
-
229
-    /**
230
-     * Get the Vidi Module Loader.
231
-     *
232
-     * @return ModuleLoader|object
233
-     */
234
-    protected function getModuleLoader()
235
-    {
236
-        return GeneralUtility::makeInstance(ModuleLoader::class);
237
-    }
22
+	/**
23
+	 * @var array
24
+	 */
25
+	protected $preferences;
26
+
27
+	/**
28
+	 * @var string
29
+	 */
30
+	protected $tableName = 'tx_vidi_preference';
31
+
32
+	/**
33
+	 * @param string $key
34
+	 * @param string $dataType
35
+	 * @return mixed
36
+	 */
37
+	public function get($key, $dataType = '')
38
+	{
39
+
40
+		if (empty($dataType)) {
41
+			$dataType = $this->getModuleLoader()->getDataType();
42
+		}
43
+
44
+		if (!$this->isLoaded($dataType)) {
45
+			$this->load($dataType);
46
+		}
47
+
48
+		$value = empty($this->preferences[$dataType][$key]) ? null : $this->preferences[$dataType][$key];
49
+		return $value;
50
+	}
51
+
52
+	/**
53
+	 * Tell whether the module is loaded.
54
+	 *
55
+	 * @param string $dataType
56
+	 * @return bool
57
+	 */
58
+	public function isLoaded($dataType)
59
+	{
60
+		return !empty($this->preferences[$dataType]);
61
+	}
62
+
63
+	/**
64
+	 * @param string $dataType
65
+	 * @return array
66
+	 */
67
+	public function getAll($dataType = '')
68
+	{
69
+
70
+		if (empty($dataType)) {
71
+			$dataType = $this->getModuleLoader()->getDataType();
72
+		}
73
+		$this->load($dataType);
74
+		return $this->preferences[$dataType];
75
+	}
76
+
77
+	/**
78
+	 * Get the md5 signature of the preferences.
79
+	 *
80
+	 * @param string $dataType
81
+	 * @return bool
82
+	 */
83
+	public function getSignature($dataType = '')
84
+	{
85
+		$preferences = $this->getAll($dataType);
86
+		return md5(serialize($preferences));
87
+	}
88
+
89
+	/**
90
+	 * Load preferences.
91
+	 *
92
+	 * @param string $dataType
93
+	 * @return void
94
+	 */
95
+	public function load($dataType)
96
+	{
97
+
98
+		// Fetch preferences from different sources and overlay them
99
+		$databasePreferences = $this->fetchPreferencesFromDatabase($dataType);
100
+		$generalPreferences = $this->fetchGlobalPreferencesFromTypoScript();
101
+		$specificPreferences = $this->fetchExtraPreferencesFromTypoScript($dataType);
102
+
103
+		$preferences = array_merge($generalPreferences, $specificPreferences, $databasePreferences);
104
+		$this->preferences[$dataType] = $preferences;
105
+	}
106
+
107
+	/**
108
+	 * Save preferences
109
+	 *
110
+	 * @param array $preferences
111
+	 * @return void
112
+	 */
113
+	public function save($preferences)
114
+	{
115
+		$configurableParts = ConfigurablePart::getParts();
116
+
117
+		$dataType = $this->getModuleLoader()->getDataType();
118
+		$this->getDataService()->delete(
119
+			$this->tableName,
120
+			[
121
+				'data_type' => $dataType
122
+			]
123
+		);
124
+
125
+		$sanitizedPreferences = [];
126
+		foreach ($preferences as $key => $value) {
127
+			if (in_array($key, $configurableParts)) {
128
+				$sanitizedPreferences[$key] = $value;
129
+			}
130
+		}
131
+
132
+		$this->getDataService()->insert(
133
+			$this->tableName,
134
+			[
135
+				'data_type' => $dataType,
136
+				'preferences' => serialize($sanitizedPreferences),
137
+			]
138
+		);
139
+	}
140
+
141
+	/**
142
+	 * @param $dataType
143
+	 * @return array
144
+	 */
145
+	public function fetchPreferencesFromDatabase($dataType)
146
+	{
147
+		$preferences = [];
148
+		$record = $this->getDataService()->getRecord(
149
+			$this->tableName,
150
+			[
151
+				'data_type' => $dataType
152
+			]
153
+		);
154
+
155
+		if (!empty($record)) {
156
+			$preferences = unserialize($record['preferences']);
157
+		}
158
+
159
+		return $preferences;
160
+	}
161
+
162
+	/**
163
+	 * Returns the module settings.
164
+	 *
165
+	 * @return array
166
+	 */
167
+	protected function fetchGlobalPreferencesFromTypoScript()
168
+	{
169
+		$settings = $this->getSettings();
170
+
171
+		$configurableParts = ConfigurablePart::getParts();
172
+		$preferences = [];
173
+		foreach ($settings as $key => $value) {
174
+			if (in_array($key, $configurableParts)) {
175
+				$preferences[$key] = $value;
176
+			}
177
+		}
178
+
179
+		return $preferences;
180
+	}
181
+
182
+	/**
183
+	 * Returns the module settings.
184
+	 *
185
+	 * @param string $dataType
186
+	 * @return array
187
+	 */
188
+	protected function fetchExtraPreferencesFromTypoScript($dataType)
189
+	{
190
+		$generalSettings = $this->getSettings();
191
+
192
+		$preferences = [];
193
+		if (isset($generalSettings[$dataType . '.'])) {
194
+			$settings = $generalSettings[$dataType . '.'];
195
+
196
+			$configurableParts = ConfigurablePart::getParts();
197
+			foreach ($settings as $key => $value) {
198
+				if (in_array($key, $configurableParts)) {
199
+					$preferences[$key] = $value;
200
+				}
201
+			}
202
+		}
203
+
204
+		return $preferences;
205
+	}
206
+
207
+	/**
208
+	 * Returns the module settings.
209
+	 *
210
+	 * @return array
211
+	 */
212
+	protected function getSettings()
213
+	{
214
+		/** @var BackendConfigurationManager $backendConfigurationManager */
215
+		$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
216
+		$backendConfigurationManager = $objectManager->get(BackendConfigurationManager::class);
217
+		$configuration = $backendConfigurationManager->getTypoScriptSetup();
218
+		return $configuration['module.']['tx_vidi.']['settings.'];
219
+	}
220
+
221
+	/**
222
+	 * @return object|DataService
223
+	 */
224
+	protected function getDataService(): DataService
225
+	{
226
+		return GeneralUtility::makeInstance(DataService::class);
227
+	}
228
+
229
+	/**
230
+	 * Get the Vidi Module Loader.
231
+	 *
232
+	 * @return ModuleLoader|object
233
+	 */
234
+	protected function getModuleLoader()
235
+	{
236
+		return GeneralUtility::makeInstance(ModuleLoader::class);
237
+	}
238 238
 
239 239
 }
Please login to merge, or discard this patch.
Classes/Controller/UserPreferencesController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
 
30 30
         $dataType = $this->getModuleLoader()->getDataType();
31 31
 
32
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_' . $key;
32
+        $key = $dataType.'_'.$this->getBackendUserIdentifier().'_'.$key;
33 33
         $this->getCacheInstance()->set($key, $value, [], 0);
34 34
 
35
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_signature';
35
+        $key = $dataType.'_'.$this->getBackendUserIdentifier().'_signature';
36 36
         $this->getCacheInstance()->set($key, $preferenceSignature, [], 0);
37 37
 
38 38
         return 'OK';
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -20,69 +20,69 @@
 block discarded – undo
20 20
 class UserPreferencesController extends ActionController
21 21
 {
22 22
 
23
-    /**
24
-     * @param string $key
25
-     * @param string $value
26
-     * @param string $preferenceSignature
27
-     * @return string
28
-     */
29
-    public function saveAction($key, $value, $preferenceSignature)
30
-    {
23
+	/**
24
+	 * @param string $key
25
+	 * @param string $value
26
+	 * @param string $preferenceSignature
27
+	 * @return string
28
+	 */
29
+	public function saveAction($key, $value, $preferenceSignature)
30
+	{
31 31
 
32
-        $dataType = $this->getModuleLoader()->getDataType();
32
+		$dataType = $this->getModuleLoader()->getDataType();
33 33
 
34
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_' . $key;
35
-        $this->getCacheInstance()->set($key, $value, [], 0);
34
+		$key = $dataType . '_' . $this->getBackendUserIdentifier() . '_' . $key;
35
+		$this->getCacheInstance()->set($key, $value, [], 0);
36 36
 
37
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_signature';
38
-        $this->getCacheInstance()->set($key, $preferenceSignature, [], 0);
37
+		$key = $dataType . '_' . $this->getBackendUserIdentifier() . '_signature';
38
+		$this->getCacheInstance()->set($key, $preferenceSignature, [], 0);
39 39
 
40
-        return 'OK';
41
-    }
40
+		return 'OK';
41
+	}
42 42
 
43
-    /**
44
-     * @return int
45
-     */
46
-    protected function getBackendUserIdentifier()
47
-    {
48
-        return $this->getBackendUser()->user['uid'];
49
-    }
43
+	/**
44
+	 * @return int
45
+	 */
46
+	protected function getBackendUserIdentifier()
47
+	{
48
+		return $this->getBackendUser()->user['uid'];
49
+	}
50 50
 
51
-    /**
52
-     * Returns an instance of the current Backend User.
53
-     *
54
-     * @return BackendUserAuthentication
55
-     */
56
-    protected function getBackendUser()
57
-    {
58
-        return $GLOBALS['BE_USER'];
59
-    }
51
+	/**
52
+	 * Returns an instance of the current Backend User.
53
+	 *
54
+	 * @return BackendUserAuthentication
55
+	 */
56
+	protected function getBackendUser()
57
+	{
58
+		return $GLOBALS['BE_USER'];
59
+	}
60 60
 
61
-    /**
62
-     * Get the Vidi Module Loader.
63
-     *
64
-     * @return ModuleLoader
65
-     */
66
-    protected function getModuleLoader()
67
-    {
68
-        return GeneralUtility::makeInstance(ModuleLoader::class);
69
-    }
61
+	/**
62
+	 * Get the Vidi Module Loader.
63
+	 *
64
+	 * @return ModuleLoader
65
+	 */
66
+	protected function getModuleLoader()
67
+	{
68
+		return GeneralUtility::makeInstance(ModuleLoader::class);
69
+	}
70 70
 
71
-    /**
72
-     * @return AbstractFrontend
73
-     */
74
-    protected function getCacheInstance()
75
-    {
76
-        return $this->getCacheManager()->getCache('vidi');
77
-    }
71
+	/**
72
+	 * @return AbstractFrontend
73
+	 */
74
+	protected function getCacheInstance()
75
+	{
76
+		return $this->getCacheManager()->getCache('vidi');
77
+	}
78 78
 
79
-    /**
80
-     * Return the Cache Manager
81
-     *
82
-     * @return CacheManager
83
-     */
84
-    protected function getCacheManager()
85
-    {
86
-        return GeneralUtility::makeInstance(CacheManager::class);
87
-    }
79
+	/**
80
+	 * Return the Cache Manager
81
+	 *
82
+	 * @return CacheManager
83
+	 */
84
+	protected function getCacheManager()
85
+	{
86
+		return GeneralUtility::makeInstance(CacheManager::class);
87
+	}
88 88
 }
Please login to merge, or discard this patch.
Classes/Grid/ColumnRendererAbstract.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         if (is_string($configuration)) {
63 63
             $configuration = $legacyParameterConfiguration;
64
-            GeneralUtility::deprecationLog('ColumnRendererAbstract: first parameter must now be an array. Please edit me in ' . get_class($this));
64
+            GeneralUtility::deprecationLog('ColumnRendererAbstract: first parameter must now be an array. Please edit me in '.get_class($this));
65 65
         }
66 66
         $this->configuration = $configuration;
67 67
     }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      * @see http://www.php.net/manual/function.htmlentities.php
175 175
      * @api
176 176
      */
177
-    protected function secure($value , $keepQuotes = false, $encoding = 'UTF-8')
177
+    protected function secure($value, $keepQuotes = false, $encoding = 'UTF-8')
178 178
     {
179 179
         $flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
180 180
         return htmlspecialchars($value, $flags, $encoding);
Please login to merge, or discard this patch.
Indentation   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -19,191 +19,191 @@
 block discarded – undo
19 19
 abstract class ColumnRendererAbstract implements ColumnRendererInterface
20 20
 {
21 21
 
22
-    /**
23
-     * The content object.
24
-     *
25
-     * @var Content
26
-     */
27
-    protected $object;
28
-
29
-    /**
30
-     * @var string
31
-     */
32
-    protected $fieldName;
33
-
34
-    /**
35
-     * @var int
36
-     */
37
-    protected $rowIndex;
38
-
39
-    /**
40
-     * @var array
41
-     */
42
-    protected $fieldConfiguration = [];
43
-
44
-    /**
45
-     * @var array
46
-     */
47
-    protected $gridRendererConfiguration = [];
48
-
49
-    /**
50
-     * @var array
51
-     */
52
-    protected $configuration = [];
53
-
54
-    /**
55
-     * Constructor of a Generic component in Vidi.
56
-     *
57
-     * @param array $configuration
58
-     * @param array $legacyParameterConfiguration
59
-     */
60
-    public function __construct($configuration = [], $legacyParameterConfiguration = array())
61
-    {
62
-        if (is_string($configuration)) {
63
-            $configuration = $legacyParameterConfiguration;
64
-            GeneralUtility::deprecationLog('ColumnRendererAbstract: first parameter must now be an array. Please edit me in ' . get_class($this));
65
-        }
66
-        $this->configuration = $configuration;
67
-    }
68
-
69
-    /**
70
-     * @return array
71
-     */
72
-    public function getConfiguration()
73
-    {
74
-        return $this->configuration;
75
-    }
76
-
77
-    /**
78
-     * @return Content
79
-     */
80
-    public function getObject()
81
-    {
82
-        return $this->object;
83
-    }
84
-
85
-    /**
86
-     * @param Content $object
87
-     * @return $this
88
-     */
89
-    public function setObject($object)
90
-    {
91
-        $this->object = $object;
92
-        return $this;
93
-    }
94
-
95
-    /**
96
-     * @return string
97
-     */
98
-    public function getFieldName()
99
-    {
100
-        return $this->fieldName;
101
-    }
102
-
103
-    /**
104
-     * @param string $fieldName
105
-     * @return $this
106
-     */
107
-    public function setFieldName($fieldName)
108
-    {
109
-        $this->fieldName = $fieldName;
110
-        return $this;
111
-    }
112
-
113
-    /**
114
-     * @return int
115
-     */
116
-    public function getRowIndex()
117
-    {
118
-        return $this->rowIndex;
119
-    }
120
-
121
-    /**
122
-     * @param int $rowIndex
123
-     * @return $this
124
-     */
125
-    public function setRowIndex($rowIndex)
126
-    {
127
-        $this->rowIndex = $rowIndex;
128
-        return $this;
129
-    }
130
-
131
-    /**
132
-     * @return array
133
-     */
134
-    public function getFieldConfiguration()
135
-    {
136
-        return $this->fieldConfiguration;
137
-    }
138
-
139
-    /**
140
-     * @param array $fieldConfiguration
141
-     * @return $this
142
-     */
143
-    public function setFieldConfiguration($fieldConfiguration)
144
-    {
145
-        $this->fieldConfiguration = $fieldConfiguration;
146
-        return $this;
147
-    }
148
-
149
-    /**
150
-     * @return array
151
-     */
152
-    public function getGridRendererConfiguration()
153
-    {
154
-        return $this->gridRendererConfiguration;
155
-    }
156
-
157
-    /**
158
-     * @param array $gridRendererConfiguration
159
-     * @return $this
160
-     */
161
-    public function setGridRendererConfiguration($gridRendererConfiguration)
162
-    {
163
-        $this->gridRendererConfiguration = $gridRendererConfiguration;
164
-        return $this;
165
-    }
166
-
167
-    /**
168
-     * Escapes special characters with their escaped counterparts as needed using PHPs htmlentities() function.
169
-     *
170
-     * @param string $value string to format
171
-     * @param bool $keepQuotes if TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
172
-     * @param string $encoding
173
-     * @return string
174
-     * @see http://www.php.net/manual/function.htmlentities.php
175
-     * @api
176
-     */
177
-    protected function secure($value , $keepQuotes = false, $encoding = 'UTF-8')
178
-    {
179
-        $flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
180
-        return htmlspecialchars($value, $flags, $encoding);
181
-    }
182
-
183
-    /**
184
-     * Get the Vidi Module Loader.
185
-     *
186
-     * @return object|ModuleLoader
187
-     */
188
-    protected function getModuleLoader()
189
-    {
190
-        return GeneralUtility::makeInstance(ModuleLoader::class);
191
-    }
192
-
193
-    /**
194
-     * @return object|IconFactory
195
-     */
196
-    protected function getIconFactory()
197
-    {
198
-        return GeneralUtility::makeInstance(IconFactory::class);
199
-    }
200
-
201
-    /**
202
-     * @return object|LanguageService
203
-     */
204
-    protected function getLanguageService()
205
-    {
206
-        return GeneralUtility::makeInstance(LanguageService::class);
207
-    }
22
+	/**
23
+	 * The content object.
24
+	 *
25
+	 * @var Content
26
+	 */
27
+	protected $object;
28
+
29
+	/**
30
+	 * @var string
31
+	 */
32
+	protected $fieldName;
33
+
34
+	/**
35
+	 * @var int
36
+	 */
37
+	protected $rowIndex;
38
+
39
+	/**
40
+	 * @var array
41
+	 */
42
+	protected $fieldConfiguration = [];
43
+
44
+	/**
45
+	 * @var array
46
+	 */
47
+	protected $gridRendererConfiguration = [];
48
+
49
+	/**
50
+	 * @var array
51
+	 */
52
+	protected $configuration = [];
53
+
54
+	/**
55
+	 * Constructor of a Generic component in Vidi.
56
+	 *
57
+	 * @param array $configuration
58
+	 * @param array $legacyParameterConfiguration
59
+	 */
60
+	public function __construct($configuration = [], $legacyParameterConfiguration = array())
61
+	{
62
+		if (is_string($configuration)) {
63
+			$configuration = $legacyParameterConfiguration;
64
+			GeneralUtility::deprecationLog('ColumnRendererAbstract: first parameter must now be an array. Please edit me in ' . get_class($this));
65
+		}
66
+		$this->configuration = $configuration;
67
+	}
68
+
69
+	/**
70
+	 * @return array
71
+	 */
72
+	public function getConfiguration()
73
+	{
74
+		return $this->configuration;
75
+	}
76
+
77
+	/**
78
+	 * @return Content
79
+	 */
80
+	public function getObject()
81
+	{
82
+		return $this->object;
83
+	}
84
+
85
+	/**
86
+	 * @param Content $object
87
+	 * @return $this
88
+	 */
89
+	public function setObject($object)
90
+	{
91
+		$this->object = $object;
92
+		return $this;
93
+	}
94
+
95
+	/**
96
+	 * @return string
97
+	 */
98
+	public function getFieldName()
99
+	{
100
+		return $this->fieldName;
101
+	}
102
+
103
+	/**
104
+	 * @param string $fieldName
105
+	 * @return $this
106
+	 */
107
+	public function setFieldName($fieldName)
108
+	{
109
+		$this->fieldName = $fieldName;
110
+		return $this;
111
+	}
112
+
113
+	/**
114
+	 * @return int
115
+	 */
116
+	public function getRowIndex()
117
+	{
118
+		return $this->rowIndex;
119
+	}
120
+
121
+	/**
122
+	 * @param int $rowIndex
123
+	 * @return $this
124
+	 */
125
+	public function setRowIndex($rowIndex)
126
+	{
127
+		$this->rowIndex = $rowIndex;
128
+		return $this;
129
+	}
130
+
131
+	/**
132
+	 * @return array
133
+	 */
134
+	public function getFieldConfiguration()
135
+	{
136
+		return $this->fieldConfiguration;
137
+	}
138
+
139
+	/**
140
+	 * @param array $fieldConfiguration
141
+	 * @return $this
142
+	 */
143
+	public function setFieldConfiguration($fieldConfiguration)
144
+	{
145
+		$this->fieldConfiguration = $fieldConfiguration;
146
+		return $this;
147
+	}
148
+
149
+	/**
150
+	 * @return array
151
+	 */
152
+	public function getGridRendererConfiguration()
153
+	{
154
+		return $this->gridRendererConfiguration;
155
+	}
156
+
157
+	/**
158
+	 * @param array $gridRendererConfiguration
159
+	 * @return $this
160
+	 */
161
+	public function setGridRendererConfiguration($gridRendererConfiguration)
162
+	{
163
+		$this->gridRendererConfiguration = $gridRendererConfiguration;
164
+		return $this;
165
+	}
166
+
167
+	/**
168
+	 * Escapes special characters with their escaped counterparts as needed using PHPs htmlentities() function.
169
+	 *
170
+	 * @param string $value string to format
171
+	 * @param bool $keepQuotes if TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
172
+	 * @param string $encoding
173
+	 * @return string
174
+	 * @see http://www.php.net/manual/function.htmlentities.php
175
+	 * @api
176
+	 */
177
+	protected function secure($value , $keepQuotes = false, $encoding = 'UTF-8')
178
+	{
179
+		$flags = $keepQuotes ? ENT_NOQUOTES : ENT_COMPAT;
180
+		return htmlspecialchars($value, $flags, $encoding);
181
+	}
182
+
183
+	/**
184
+	 * Get the Vidi Module Loader.
185
+	 *
186
+	 * @return object|ModuleLoader
187
+	 */
188
+	protected function getModuleLoader()
189
+	{
190
+		return GeneralUtility::makeInstance(ModuleLoader::class);
191
+	}
192
+
193
+	/**
194
+	 * @return object|IconFactory
195
+	 */
196
+	protected function getIconFactory()
197
+	{
198
+		return GeneralUtility::makeInstance(IconFactory::class);
199
+	}
200
+
201
+	/**
202
+	 * @return object|LanguageService
203
+	 */
204
+	protected function getLanguageService()
205
+	{
206
+		return GeneralUtility::makeInstance(LanguageService::class);
207
+	}
208 208
 
209 209
 }
Please login to merge, or discard this patch.
Classes/Configuration/ConfigurationUtility.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -18,68 +18,68 @@
 block discarded – undo
18 18
 class ConfigurationUtility implements SingletonInterface
19 19
 {
20 20
 
21
-    /**
22
-     * @var string
23
-     */
24
-    protected $extensionKey = 'vidi';
21
+	/**
22
+	 * @var string
23
+	 */
24
+	protected $extensionKey = 'vidi';
25 25
 
26
-    /**
27
-     * @var array
28
-     */
29
-    protected $configuration = [];
26
+	/**
27
+	 * @var array
28
+	 */
29
+	protected $configuration = [];
30 30
 
31
-    /**
32
-     * Returns a class instance.
33
-     *
34
-     * @return ConfigurationUtility|object
35
-     * @throws \InvalidArgumentException
36
-     */
37
-    static public function getInstance()
38
-    {
39
-        return GeneralUtility::makeInstance(self::class);
40
-    }
31
+	/**
32
+	 * Returns a class instance.
33
+	 *
34
+	 * @return ConfigurationUtility|object
35
+	 * @throws \InvalidArgumentException
36
+	 */
37
+	static public function getInstance()
38
+	{
39
+		return GeneralUtility::makeInstance(self::class);
40
+	}
41 41
 
42
-    /**
43
-     * Constructor
44
-     */
45
-    public function __construct()
46
-    {
47
-        $configuration = $configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extensionKey);
42
+	/**
43
+	 * Constructor
44
+	 */
45
+	public function __construct()
46
+	{
47
+		$configuration = $configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extensionKey);
48 48
 
49
-        // Fill up configuration array with relevant values.
50
-        foreach ($configuration as $key => $value) {
51
-            $this->configuration[$key] = $value;
52
-        }
53
-    }
49
+		// Fill up configuration array with relevant values.
50
+		foreach ($configuration as $key => $value) {
51
+			$this->configuration[$key] = $value;
52
+		}
53
+	}
54 54
 
55
-    /**
56
-     * Returns a setting key.
57
-     *
58
-     * @param string $key
59
-     * @return array
60
-     */
61
-    public function get($key)
62
-    {
63
-        return isset($this->configuration[$key]) ? $this->configuration[$key] : null;
64
-    }
55
+	/**
56
+	 * Returns a setting key.
57
+	 *
58
+	 * @param string $key
59
+	 * @return array
60
+	 */
61
+	public function get($key)
62
+	{
63
+		return isset($this->configuration[$key]) ? $this->configuration[$key] : null;
64
+	}
65 65
 
66
-    /**
67
-     * Set a setting key.
68
-     *
69
-     * @param string $key
70
-     * @param mixed $value
71
-     * @return void
72
-     */
73
-    public function set($key, $value)
74
-    {
75
-        $this->configuration[$key] = $value;
76
-    }
66
+	/**
67
+	 * Set a setting key.
68
+	 *
69
+	 * @param string $key
70
+	 * @param mixed $value
71
+	 * @return void
72
+	 */
73
+	public function set($key, $value)
74
+	{
75
+		$this->configuration[$key] = $value;
76
+	}
77 77
 
78
-    /**
79
-     * @return array
80
-     */
81
-    public function getConfiguration()
82
-    {
83
-        return $this->configuration;
84
-    }
78
+	/**
79
+	 * @return array
80
+	 */
81
+	public function getConfiguration()
82
+	{
83
+		return $this->configuration;
84
+	}
85 85
 }
Please login to merge, or discard this patch.