No longer need to test for type, it should exist
This commit is contained in:
@@ -294,7 +294,7 @@ class Product extends Model implements IDs
|
||||
*/
|
||||
public function getSuppliedAttribute(): ?Model
|
||||
{
|
||||
return $this->type && $this->type->supplied ? $this->type->supplied : NULL;
|
||||
return $this->type->supplied ? $this->type->supplied : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -426,7 +426,7 @@ class Product extends Model implements IDs
|
||||
*/
|
||||
public function hasUsage(): bool
|
||||
{
|
||||
return $this->type && $this->type->hasUsage();
|
||||
return $this->type->hasUsage();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -786,7 +786,7 @@ class Service extends Model implements IDs
|
||||
*/
|
||||
public function getNameShortAttribute()
|
||||
{
|
||||
return ($this->type && $this->type->getServiceNameAttribute()) ? $this->type->getServiceNameAttribute() : 'SID:'.$this->sid;
|
||||
return $this->type->getServiceNameAttribute() ? $this->type->getServiceNameAttribute() : 'SID:'.$this->sid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -801,7 +801,7 @@ class Service extends Model implements IDs
|
||||
*/
|
||||
public function getNameDetailAttribute()
|
||||
{
|
||||
return ($this->type && ($this->type->getServiceDescriptionAttribute() !== NULL)) ? $this->type->getServiceDescriptionAttribute() : 'No Description';
|
||||
return ($this->type->getServiceDescriptionAttribute() !== NULL) ? $this->type->getServiceDescriptionAttribute() : 'No Description';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -45,10 +45,11 @@ class SSL extends Type
|
||||
if ($this->cert)
|
||||
return Arr::get($this->crt_parse,'name');
|
||||
|
||||
else {
|
||||
elseif ($this->csr) {
|
||||
$dn = '';
|
||||
$dna = openssl_csr_get_subject($this->csr);
|
||||
|
||||
dump(['dna'=>$dna,'csr'=>$this->csr,'id',$this->id]);
|
||||
foreach ($dna as $k=>$v) {
|
||||
if ($dn)
|
||||
$dn .= ',';
|
||||
@@ -57,6 +58,8 @@ class SSL extends Type
|
||||
}
|
||||
|
||||
return $dn;
|
||||
} else {
|
||||
return '[NO DN]';
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user