| 1 | <?php |
||
| 18 | abstract class AbstractInputField implements InputFieldInterface |
||
| 19 | { |
||
| 20 | |||
| 21 | use FieldsArgumentsAwareObjectTrait, AutoNameTrait; |
||
| 22 | |||
| 23 | protected $isFinal = false; |
||
| 24 | |||
| 25 | 84 | public function __construct(array $config = []) |
|
| 26 | { |
||
| 27 | 84 | if (empty($config['type'])) { |
|
| 28 | 1 | $config['type'] = $this->getType(); |
|
| 29 | 1 | $config['name'] = $this->getName(); |
|
| 30 | 1 | } |
|
| 31 | |||
| 32 | 84 | if (TypeService::isScalarType($config['type'])) { |
|
| 33 | 48 | $config['type'] = TypeFactory::getScalarType($config['type']); |
|
| 34 | 48 | } |
|
| 35 | |||
| 36 | 84 | $this->config = new InputFieldConfig($config, $this, $this->isFinal); |
|
| 37 | 84 | $this->build($this->config); |
|
| 38 | 84 | } |
|
| 39 | |||
| 40 | 84 | public function build(InputFieldConfig $config) |
|
|
|
|||
| 41 | { |
||
| 42 | |||
| 43 | 84 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @return InputTypeInterface |
||
| 47 | */ |
||
| 48 | abstract public function getType(); |
||
| 49 | |||
| 50 | 1 | public function getDefaultValue() |
|
| 54 | |||
| 55 | //todo: think about serialize, parseValue methods |
||
| 56 | |||
| 57 | } |
||
| 58 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.