Fixed errors VC
This commit is contained in:
parent
8672629dd6
commit
b2f356bd4b
|
@ -20,30 +20,6 @@ final class Label extends Item
|
|||
protected static $useLinkedVisualConsole = true;
|
||||
|
||||
|
||||
/**
|
||||
* Validate the received data structure to ensure if we can extract the
|
||||
* values required to build the model.
|
||||
*
|
||||
* @param array $data Input data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException If any input value is considered
|
||||
* invalid.
|
||||
*
|
||||
* @overrides Item->validateData.
|
||||
*/
|
||||
protected function validateData(array $data): void
|
||||
{
|
||||
parent::validateData($data);
|
||||
if (static::notEmptyStringOr(static::issetInArray($data, ['label']), null) === null) {
|
||||
throw new \InvalidArgumentException(
|
||||
'the label property is required and should be a not empty string'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a valid representation of the model.
|
||||
*
|
||||
|
@ -102,6 +78,15 @@ final class Label extends Item
|
|||
// Retrieve global - common inputs.
|
||||
$values = parent::getDefaultGeneralValues($values);
|
||||
|
||||
// Default values.
|
||||
if (isset($values['width']) === false) {
|
||||
$values['width'] = 10;
|
||||
}
|
||||
|
||||
if (isset($values['height']) === false) {
|
||||
$values['height'] = 10;
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
|
|
@ -442,6 +442,7 @@ p.error-p-validate {
|
|||
}
|
||||
|
||||
.visual-console-item .digital-clock > span.date {
|
||||
font-family: "Alarm Clock", "Courier New", Courier, monospace;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -342,6 +342,7 @@ p.error-p-validate {
|
|||
}
|
||||
|
||||
.visual-console-item .digital-clock > span.date {
|
||||
font-family: "Alarm Clock", "Courier New", Courier, monospace;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue