GetsComponentGroups   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getGroups() 0 3 1
1
<?php
2
3
namespace Riclep\StoryblokForms\Traits;
4
5
trait GetsComponentGroups
6
{
7
	/**
8
	 * Request all the component groups from Storyblok
9
	 *
10
	 * @return void
11
	 * @throws \Storyblok\ApiException
12
	 */
13
	protected function getGroups(): void
14
	{
15
		$this->componentGroups = collect($this->managementClient->get('spaces/'.config('storyblok.space_id').'/component_groups')->getBody()['component_groups'])->keyBy('name');
0 ignored issues
show
Bug Best Practice introduced by
The property componentGroups does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
16
	}
17
}