diff --git a/src/Definition/PatternDefinition.php b/src/Definition/PatternDefinition.php index 6d3a61a1..a48ef218 100644 --- a/src/Definition/PatternDefinition.php +++ b/src/Definition/PatternDefinition.php @@ -65,10 +65,10 @@ public function __construct(array $definition = []) { $this->id = $this->definition['id']; $this->setFields($this->definition['fields']); $this->setVariants($this->definition['variants']); - // As we know allow hyphens the pattern ID, we need to sanitise it when - // setting pattern theme hook. - $hookFriendlyId = str_replace('-', '_', $this->id()); - $this->setThemeHook(self::PATTERN_PREFIX . $hookFriendlyId); + // As we now allow hyphens in pattern IDs we need to turn them into + // underscores when setting the theme hook. + $hook_friendly_id = str_replace('-', '_', $this->id()); + $this->setThemeHook(self::PATTERN_PREFIX . $hook_friendly_id); if (!empty($definition['theme hook'])) { $this->setThemeHook($definition['theme hook']);