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

Input::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
c 0
b 0
f 0
nc 4
nop 2
dl 0
loc 10
rs 10
1
<?php
2
3
namespace Riclep\StoryblokForms;
4
5
use Riclep\StoryblokForms\Traits\HasNames;
6
use Riclep\StoryblokForms\Traits\InFieldset;
7
use Riclep\StoryblokForms\Traits\ToJson;
8
9
class Input extends \Riclep\Storyblok\Block
10
{
11
	use HasNames, InFieldset, ToJson;
0 ignored issues
show
introduced by
The trait Riclep\StoryblokForms\Traits\ToJson requires some properties which are not provided by Riclep\StoryblokForms\Input: $input_name, $input_dot_name
Loading history...
Bug introduced by
The trait Riclep\StoryblokForms\Traits\HasNames requires the property $input_name which is not provided by Riclep\StoryblokForms\Input.
Loading history...
12
13
	protected $key;
14
15
	/**
16
	 * @var string[] All the Validators for this Input
17
	 */
18
	protected $_casts = ['validators' => Validators::class];
19
20
	public function loopKey($key) {
21
		$this->key = $key;
22
23
		return $this;
24
	}
25
26
27
	/**
28
	 * All the Validation rules for this Input
29
	 *
30
	 * @return mixed
31
	 */
32
	public function validationRules() {
33
		return $this->validators->validationRules();
0 ignored issues
show
Bug Best Practice introduced by
The property validators does not exist on Riclep\StoryblokForms\Input. Since you implemented __get, consider adding a @property annotation.
Loading history...
Bug introduced by
The method validationRules() does not exist on null. ( Ignorable by Annotation )

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

33
		return $this->validators->/** @scrutinizer ignore-call */ validationRules();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
	}
35
36
	/**
37
	 * All the error messages for this Input
38
	 *
39
	 * @return mixed
40
	 */
41
	public function errorMessages() {
42
		return $this->validators->errorMessages();
0 ignored issues
show
Bug Best Practice introduced by
The property validators does not exist on Riclep\StoryblokForms\Input. Since you implemented __get, consider adding a @property annotation.
Loading history...
43
	}
44
}