Passed
Push — develop ( 945824...317753 )
by Richard
03:35
created

InFieldset::initInFieldset()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 4
c 1
b 1
f 0
dl 0
loc 7
rs 10
cc 3
nc 4
nop 0
1
<?php
2
3
namespace Riclep\StoryblokForms\Traits;
4
5
use Riclep\StoryblokForms\Blocks\LsfFieldset;
6
use Riclep\StoryblokForms\Blocks\LsfRepeatingFieldset;
7
8
trait InFieldset
9
{
10
	protected $inFieldSet = false;
11
	protected $isRepeating = false;
12
13
	protected function initInFieldset() {
14
		if ($this->parent() instanceof LsfFieldset) {
0 ignored issues
show
Bug introduced by
It seems like parent() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
		if ($this->/** @scrutinizer ignore-call */ parent() instanceof LsfFieldset) {
Loading history...
15
			$this->inFieldSet = true;
16
		}
17
18
		if ($this->parent() instanceof LsfRepeatingFieldset) {
19
			$this->isRepeating = true;
20
		}
21
	}
22
23
}