|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
|
|
4
|
|
|
namespace oliverde8\ComfyBundle\Model; |
|
5
|
|
|
|
|
6
|
|
|
|
|
7
|
|
|
use oliverde8\ComfyBundle\Manager\ConfigManagerInterface; |
|
8
|
|
|
use Symfony\Component\Validator\Validator\ValidatorInterface; |
|
|
|
|
|
|
9
|
|
|
|
|
10
|
|
|
class SelectConfig extends TextConfig |
|
11
|
|
|
{ |
|
12
|
|
|
/** @var string[] */ |
|
13
|
|
|
protected $options = []; |
|
14
|
|
|
|
|
15
|
|
|
/** @var boolean */ |
|
16
|
|
|
protected $allowMultiple; |
|
17
|
|
|
|
|
18
|
|
|
public function __construct( |
|
19
|
|
|
ConfigManagerInterface $configManager, |
|
20
|
|
|
ValidatorInterface $validator, |
|
21
|
|
|
string $path, |
|
22
|
|
|
string $name, |
|
23
|
|
|
string $description = "", |
|
24
|
|
|
int $scope = PHP_INT_MAX, |
|
25
|
|
|
?string $defaultValue = null, |
|
26
|
|
|
bool $isHidden = false, |
|
27
|
|
|
$options = [], |
|
28
|
|
|
$allowMultiple = false |
|
29
|
|
|
) { |
|
30
|
|
|
dump($defaultValue); |
|
31
|
|
|
parent::__construct($configManager, $validator, $path, $name, $description, $scope, $defaultValue, $isHidden); |
|
32
|
|
|
|
|
33
|
|
|
$this->options = $options; |
|
34
|
|
|
$this->allowMultiple = $allowMultiple; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Serialize value to save it in Database. |
|
40
|
|
|
* |
|
41
|
|
|
* @param $value |
|
42
|
|
|
* |
|
43
|
|
|
* @return string|null |
|
44
|
|
|
*/ |
|
45
|
|
|
protected function serialize($value): ?string |
|
46
|
|
|
{ |
|
47
|
|
|
return json_encode($value); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Deserialize value read from database. |
|
52
|
|
|
* |
|
53
|
|
|
* @param string|null $value |
|
54
|
|
|
* |
|
55
|
|
|
* @return mixed|null |
|
56
|
|
|
*/ |
|
57
|
|
|
protected function deserialize(?string $value) |
|
58
|
|
|
{ |
|
59
|
|
|
dump($value); |
|
60
|
|
|
dump("toto"); |
|
61
|
|
|
return json_decode($value); |
|
|
|
|
|
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return string[] |
|
66
|
|
|
*/ |
|
67
|
|
|
public function getOptions() |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->options; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @return bool |
|
74
|
|
|
*/ |
|
75
|
|
|
public function isAllowMultiple() |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->allowMultiple; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
|
|
81
|
|
|
} |
|
82
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths