Code Duplication    Length = 6-6 lines in 2 locations

app/Widgets.php 1 location

@@ 42-47 (lines=6) @@
39
	public function getAll(): array
40
	{
41
		$widgets = [];
42
		if (\App\Cache::has('Widgets', $this->moduleName)) {
43
			$widgetsData = \App\Cache::get('Widgets', $this->moduleName);
44
		} else {
45
			$widgetsData = \App\Api::getInstance()->call("{$this->moduleName}/Widgets") ?: [];
46
			\App\Cache::save('Widgets', $this->moduleName, $widgetsData, \App\Cache::LONG);
47
		}
48
		foreach ($widgetsData as $widgetData) {
49
			if (!\in_array($widgetData['type'], ['RelatedModule'])) {
50
				continue;

modules/Base/Model/Module.php 1 location

@@ 123-128 (lines=6) @@
120
	 */
121
	public function getFieldsFromApi(): array
122
	{
123
		if (\App\Cache::has('moduleFields', $this->moduleName)) {
124
			$data = \App\Cache::get('moduleFields', $this->moduleName);
125
		} else {
126
			$data = Api::getInstance()->call($this->moduleName . '/Fields');
127
			\App\Cache::save('moduleFields', $this->moduleName, $data);
128
		}
129
		return $data;
130
	}
131