super-powers/src/ff7d0111-8f79-42aa-ac14-b53.../code.power

25 lines
504 B
Plaintext

/**
* Check if a registry path exists and is a string
*
* @param string $path Registry path (e.g. joomla.content.showauthor)
*
* @return boolean
* @since 3.2.0
*/
public function isString(string $path): bool
{
// Return default value if path is empty
if (empty($path)) {
return false;
}
// get the value
if (($node = $this->get($path)) !== null
&& is_string($node)
&& strlen((string) $node) > 0)
{
return true;
}
return false;
}