Skip empty values

This commit is contained in:
Frank Fenor 2024-02-24 17:59:48 +01:00
parent 77b28327c8
commit a2cb829d27
No known key found for this signature in database
GPG key ID: E6B5029FCCE96376

View file

@ -270,8 +270,11 @@ class LCSCProvider implements InfoProviderInterface
foreach ($attributes as $attribute) {
//Skip this attribute if it's empty
if (in_array(trim($attribute['paramValueEn']), array('', '-'))) {
continue;
//If the attribute contains a tilde we assume it is a range
if (str_contains($attribute['paramValueEn'], '~')) {
} elseif (str_contains($attribute['paramValueEn'], '~')) {
$parts = explode('~', $attribute['paramValueEn']);
if (count($parts) === 2) {
//Try to extract number and unit from value (allow leading +)