Added TDF validation script
This commit is contained in:
27
build/scripts/TargetDescriptionFiles/Variant.php
Normal file
27
build/scripts/TargetDescriptionFiles/Variant.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class Variant
|
||||
{
|
||||
public ?string $name = null;
|
||||
public ?string $package = null;
|
||||
public ?string $pinout = null;
|
||||
|
||||
public function validate(): array
|
||||
{
|
||||
$failures = [];
|
||||
|
||||
if (empty($this->name)) {
|
||||
$failures[] = 'Name not found';
|
||||
}
|
||||
|
||||
if ($this->name == "standard") {
|
||||
$failures[] = 'Name set to "standard" - needs attention';
|
||||
}
|
||||
|
||||
if (empty($this->package)) {
|
||||
$failures[] = 'Package not found';
|
||||
}
|
||||
|
||||
return $failures;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user