Fixed errors VC

This commit is contained in:
Daniel Barbero Martin 2020-01-21 10:42:09 +01:00
parent 8672629dd6
commit b2f356bd4b
4 changed files with 12 additions and 25 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}