GetsComponentGroups::getGroups()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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
}