/**
  * Register a shortcode.
  *
  * @param  Shortcode $shortcode An instance of ShortcodeInterface.
  * @param  array  $options      An array of defaults options for the
  *                              shortcode.
  *
  * @return bool                 Return status code (true on success).
  */
 public function register($shortcode, $options = [])
 {
     // Register shortcodes from array
     if (is_array($shortcode)) {
         foreach ($shortcode as $item) {
             $this->register($item, $options);
         }
         // Register shortcodes from (built-in) classes
     } elseif ($shortcode instanceof ShortcodeInterface) {
         $options += $shortcode->getShortcode();
         $name = $options['name'];
         $this->shortcodes[$name] = $shortcode;
         switch ($options['type']) {
             case 'inline':
                 $this->twig->addShortcode(new InlineShortcode($name, [$shortcode, 'execute'], $options));
                 return true;
             case 'block':
                 $this->twig->addShortcode(new BlockShortcode($name, [$shortcode, 'execute'], $options));
                 return true;
             default:
                 break;
         }
         // Register shortcodes from Shortcode functions
     } elseif ($shortcode instanceof Twig\GenericShortcode) {
         $this->twig->addShortcode($shortcode);
         return true;
         // Register shortcode filters from ShortcodeFilter filters
     } elseif ($shortcode instanceof Twig\GenericShortcodeFilter) {
         $this->twig->addShortcodeFilter($shortcode);
         return true;
         // Register shortcodes from Shortcode extensions
     } elseif ($shortcode instanceof Twig\ExtensionInterface || is_object($shortcode)) {
         $result = false;
         if (method_exists($shortcode, 'getShortcodes')) {
             $result = true;
             $shortcodes = $shortcode->getShortcodes();
             foreach ($shortcodes as $shortcode) {
                 $this->twig->addShortcode($shortcode);
             }
         }
         if (method_exists($shortcode, 'getShortcodeFilters')) {
             $result = true;
             $shortcodeFilters = $shortcode->getShortcodeFilters();
             foreach ($shortcodeFilters as $shortcodeFilter) {
                 $this->twig->addShortcodeFilter($shortcodeFilter);
             }
         }
         return $result;
     }
     return false;
 }