--- a/pathauto.api.php	(revision )
+++ b/pathauto.api.php	(revision )
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Language\Language;
+use Drupal\pathauto\PathautoPatternInterface;
 
 /**
  * @todo Update for 8.x-1.x
@@ -93,9 +94,9 @@
  * This hook will only be called if a default pattern is configured (on
  * admin/config/search/path/patterns).
  *
- * @param string $pattern
- *   The alias pattern for Pathauto to pass to token_replace() to generate the
- *   URL alias.
+ * @param PathautoPatternInterface $pattern
+ *   The Pathauto pattern entity which need its patter to be modified using
+ *   setPattern() method.
  * @param array $context
  *   An associative array of additional options, with the following elements:
  *   - 'module': The module or entity type being aliased.
@@ -107,10 +108,10 @@
  *   - 'language': A string of the language code for the alias (e.g. 'en').
  *     This can be altered by reference.
  */
-function hook_pathauto_pattern_alter(&$pattern, array $context) {
+function hook_pathauto_pattern_alter(PathautoPatternInterface $pattern, array $context) {
   // Switch out any [node:created:*] tokens with [node:updated:*] on update.
   if ($context['module'] == 'node' && ($context['op'] == 'update')) {
-    $pattern = preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern);
+    $pattern->setPattern(preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern->getPattern()));
   }
 }
 
