Added TDF validation script

This commit is contained in:
Nav
2021-06-01 23:54:04 +01:00
parent 571211b337
commit 80749e2b5b
3 changed files with 186 additions and 0 deletions

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