League\CommonMark\Util\Configuration::getConfig PHP Method

getConfig() public method

public getConfig ( string | null $key = null, mixed $default = null ) : mixed
$key string | null
$default mixed
return mixed
    public function getConfig($key = null, $default = null)
    {
        if ($key === null) {
            return $this->config;
        }
        // accept a/b/c as ['a']['b']['c']
        if (strpos($key, '/')) {
            return $this->getConfigByPath($key, $default);
        }
        if (!isset($this->config[$key])) {
            return $default;
        }
        return $this->config[$key];
    }

Usage Example

 /**
  * @param HtmlBlock                $block
  * @param ElementRendererInterface $htmlRenderer
  * @param bool                     $inTightList
  *
  * @return string
  */
 public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
 {
     if (!$block instanceof HtmlBlock) {
         throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
     }
     if ($this->config->getConfig('safe') === true) {
         return '';
     }
     return $block->getStringContent();
 }
All Usage Examples Of League\CommonMark\Util\Configuration::getConfig