Loading src/Component/Component.php +1 −1 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ class Component { '%status' => $status, '%description' => $metadata->getDescription(), ]; $title = $this->t("[DEBUG]\n\nComponent: \"%name\" (%id).\nVariant: %variant\nStatus: %status\nDescription: %description", $args); $title = $this->t("Component: \"%name\" (%id).\nVariant: %variant\nStatus: %status\nDescription: %description", $args); $attributes['title'] = $attributes['title'] ?? $title; } return [ Loading src/Controller/ComponentAudit.php +20 −13 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ namespace Drupal\cl_components\Controller; use Drupal\cl_components\Component\Component; use Drupal\cl_components\Component\ComponentDiscovery; use Drupal\cl_components\Component\ComponentMetadata; use Drupal\cl_components\Exception\ComponentSyntaxException; use Drupal\cl_components\Exception\InvalidComponentException; use Drupal\cl_components\Parser\ComponentPhpFile; use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\Tags; use Drupal\Core\Controller\ControllerBase; Loading Loading @@ -187,17 +189,22 @@ final class ComponentAudit extends ControllerBase { ), ]; if (!$is_forked) { $hooks_message = empty($hooks) ? [ '#type' => 'html_tag', '#tag' => 'em', '#value' => $this->t('No hooks in <code>@filename</code>.', ['@filename' => $component->getId() . '.php']), ] : [ try { $hooks = $component->getMetadata()->getHooks(); } catch (ComponentSyntaxException $e) { $hooks = []; } $hooks_message = [ '#theme' => 'item_list', '#items' => array_map( static fn(string $hook) => ['#type' => 'html_tag', '#tag' => 'code', '#value' => $hook], $hooks static fn(string $hook) => [ '#type' => 'html_tag', '#tag' => 'code', '#value' => $hook, '#attributes' => ['class' => in_array($hook, $hooks, TRUE) ? 'implemented' : 'not-implemented'], ], ComponentPhpFile::SUPPORTED_CL_HOOKS ), ]; } Loading src/Parser/ComponentPhpFile.php +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use Drupal\Core\File\FileSystemInterface; class ComponentPhpFile { private const SUPPORTED_CL_HOOKS = ['form_alter', 'library_info_alter']; public const SUPPORTED_CL_HOOKS = ['form_alter', 'library_info_alter']; /** * The path to the PHP file. Loading src/assets/css/cl-registry.css +6 −0 Original line number Diff line number Diff line Loading @@ -31,3 +31,9 @@ h4:hover a.panel-item--anchor { margin: 0; padding: 0; } .item-list ul .implemented::before { content: '✅ '; } .item-list ul .not-implemented { text-decoration: line-through; } Loading
src/Component/Component.php +1 −1 Original line number Diff line number Diff line Loading @@ -274,7 +274,7 @@ class Component { '%status' => $status, '%description' => $metadata->getDescription(), ]; $title = $this->t("[DEBUG]\n\nComponent: \"%name\" (%id).\nVariant: %variant\nStatus: %status\nDescription: %description", $args); $title = $this->t("Component: \"%name\" (%id).\nVariant: %variant\nStatus: %status\nDescription: %description", $args); $attributes['title'] = $attributes['title'] ?? $title; } return [ Loading
src/Controller/ComponentAudit.php +20 −13 Original line number Diff line number Diff line Loading @@ -5,7 +5,9 @@ namespace Drupal\cl_components\Controller; use Drupal\cl_components\Component\Component; use Drupal\cl_components\Component\ComponentDiscovery; use Drupal\cl_components\Component\ComponentMetadata; use Drupal\cl_components\Exception\ComponentSyntaxException; use Drupal\cl_components\Exception\InvalidComponentException; use Drupal\cl_components\Parser\ComponentPhpFile; use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\Tags; use Drupal\Core\Controller\ControllerBase; Loading Loading @@ -187,17 +189,22 @@ final class ComponentAudit extends ControllerBase { ), ]; if (!$is_forked) { $hooks_message = empty($hooks) ? [ '#type' => 'html_tag', '#tag' => 'em', '#value' => $this->t('No hooks in <code>@filename</code>.', ['@filename' => $component->getId() . '.php']), ] : [ try { $hooks = $component->getMetadata()->getHooks(); } catch (ComponentSyntaxException $e) { $hooks = []; } $hooks_message = [ '#theme' => 'item_list', '#items' => array_map( static fn(string $hook) => ['#type' => 'html_tag', '#tag' => 'code', '#value' => $hook], $hooks static fn(string $hook) => [ '#type' => 'html_tag', '#tag' => 'code', '#value' => $hook, '#attributes' => ['class' => in_array($hook, $hooks, TRUE) ? 'implemented' : 'not-implemented'], ], ComponentPhpFile::SUPPORTED_CL_HOOKS ), ]; } Loading
src/Parser/ComponentPhpFile.php +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use Drupal\Core\File\FileSystemInterface; class ComponentPhpFile { private const SUPPORTED_CL_HOOKS = ['form_alter', 'library_info_alter']; public const SUPPORTED_CL_HOOKS = ['form_alter', 'library_info_alter']; /** * The path to the PHP file. Loading
src/assets/css/cl-registry.css +6 −0 Original line number Diff line number Diff line Loading @@ -31,3 +31,9 @@ h4:hover a.panel-item--anchor { margin: 0; padding: 0; } .item-list ul .implemented::before { content: '✅ '; } .item-list ul .not-implemented { text-decoration: line-through; }