From f3cac844bbbda7fca308054f4cbd0de9f85b4fc2 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 12:30:27 +0200 Subject: [PATCH 01/17] Fix multi-line comments and add examples --- .../directive-processing.php | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 594e592a22137f..063dbf0d8a1d5c 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -81,15 +81,24 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives if ( $latest_opening_tag_name === $tag_name ) { array_pop( $tag_stack ); - // If the matching opening tag didn't have any attribute directives, - // we move on. + /* + * If the matching opening tag didn't have any attribute directives, + * we move on. + */ if ( 0 === count( $attributes ) ) { continue; } } } else { - // Helper that removes the part after the double hyphen before looking for - // the directive processor inside `$attribute_directives`. + /* + * Helper that removes the part after the double hyphen before looking for + * the directive processor inside `$attribute_directives`. + * + * Example: + * + * 'wp-context' === $get_directive_type( 'wp-context' ); + * 'wp-bind' === $get_directive_type( 'wp-bind--src' ); + */ $get_directive_type = function ( $attr ) { return explode( '--', $attr )[0]; }; @@ -98,10 +107,12 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives $attributes = array_map( $get_directive_type, $attributes ); $attributes = array_intersect( $attributes, array_keys( $directives ) ); - // If this is an open tag, and if it either has attribute directives, or - // if we're inside a tag that does, take note of this tag and its - // attribute directives so we can call its directive processor once we - // encounter the matching closing tag. + /* + * If this is an open tag, and if it either has attribute directives, or + * if we're inside a tag that does, take note of this tag and its + * attribute directives so we can call its directive processor once we + * encounter the matching closing tag. + */ if ( ! WP_Directive_Processor::is_html_void_element( $tags->get_tag() ) && ( 0 !== count( $attributes ) || 0 !== count( $tag_stack ) ) From 250e7b128be27e7837061088bc792b11176a9b0c Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 13:37:45 +0200 Subject: [PATCH 02/17] Add parse_attribute_name static method to WP_Directive_Processor --- .../class-wp-directive-processor.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/experimental/interactivity-api/class-wp-directive-processor.php b/lib/experimental/interactivity-api/class-wp-directive-processor.php index 2315f6e286702b..608466a9c6edae 100644 --- a/lib/experimental/interactivity-api/class-wp-directive-processor.php +++ b/lib/experimental/interactivity-api/class-wp-directive-processor.php @@ -173,4 +173,21 @@ public static function is_html_void_element( $tag_name ) { return false; } } + + /** + * Extract and return the directive type and the the part after the double + * hyphen from an attribute name (if present), in an array format. + * + * Examples: + * + * 'wp-island' => array( 'wp-island', null ) + * 'wp-bind--src' => array( 'wp-bind', 'src' ) + * 'wp-thing--and--thang' => array( 'wp-thing', 'and--thang' ) + * + * @param string $name The attribute name. + * @return array The resulting array + */ + public static function parse_attribute_name( $name ) { + return explode( '--', $name, 2 ); + } } From bd8e120e0fbfc4720b74f28408da022c3c948f1c Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 13:43:33 +0200 Subject: [PATCH 03/17] Replace array functions with a foreach loop --- .../directive-processing.php | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 063dbf0d8a1d5c..e2eb5dc837c8d7 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -90,22 +90,18 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives } } } else { - /* - * Helper that removes the part after the double hyphen before looking for - * the directive processor inside `$attribute_directives`. - * - * Example: - * - * 'wp-context' === $get_directive_type( 'wp-context' ); - * 'wp-bind' === $get_directive_type( 'wp-bind--src' ); - */ - $get_directive_type = function ( $attr ) { - return explode( '--', $attr )[0]; - }; - - $attributes = $tags->get_attribute_names_with_prefix( $prefix ); - $attributes = array_map( $get_directive_type, $attributes ); - $attributes = array_intersect( $attributes, array_keys( $directives ) ); + $attributes = array(); + foreach ( $tags->get_attribute_names_with_prefix( $prefix ) as $name ) { + /* + * Removes the part after the double hyphen before looking for + * the directive processor inside `$directives`, e.g., "wp-bind" + * from "wp-bind--src" and "wp-context" from "wp-context" etc... + */ + list( $type ) = WP_Directive_Processor::parse_attribute_name( $name ); + if ( array_key_exists( $type, $directives ) ) { + $attributes[] = $name; + } + } /* * If this is an open tag, and if it either has attribute directives, or From 92a2b6f3cb8b87b9f0375517c329f19c824980ed Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 13:52:57 +0200 Subject: [PATCH 04/17] Add explanatory comment for the negation operator check --- .../interactivity-api/directive-processing.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index e2eb5dc837c8d7..45bb3ba757c85e 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -138,7 +138,12 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr array( 'context' => $context ) ); - if ( strpos( $path, '!' ) === 0 ) { + /* + * Check first if the directive is preceded by a negator operator (!), + * indicating that the value obtained from the Interactivity Store using the + * subsequent path should be negated. + */ + if ( '!' === $path[0] ) { $path = substr( $path, 1 ); $has_negation_operator = true; } From f3a59a2d91b3d8e8664c4457850e4b2dffa548cc Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 13:56:33 +0200 Subject: [PATCH 05/17] Replace $array with $path_segments --- lib/experimental/interactivity-api/directive-processing.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 45bb3ba757c85e..42cbddb0953986 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -148,9 +148,9 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr $has_negation_operator = true; } - $array = explode( '.', $path ); - $current = $store; - foreach ( $array as $p ) { + $path_segments = explode( '.', $path ); + $current = $store; + foreach ( $path_segments as $p ) { if ( isset( $current[ $p ] ) ) { $current = $current[ $p ]; } else { From 7e0274060f5e6d73084f19c53e25f2f960193fb6 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 15:06:46 +0200 Subject: [PATCH 06/17] Minor fix for the negation operator comment --- lib/experimental/interactivity-api/directive-processing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 42cbddb0953986..7688a24a2e752c 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -139,7 +139,7 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr ); /* - * Check first if the directive is preceded by a negator operator (!), + * Check first if the directive path is preceded by a negator operator (!), * indicating that the value obtained from the Interactivity Store using the * subsequent path should be negated. */ From 8a1795eab53dac56d4e88666b86782efc833b3b7 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 16:37:01 +0200 Subject: [PATCH 07/17] Call only instances of Closure --- .../interactivity-api/directive-processing.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 7688a24a2e752c..d09d7413767c89 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -158,8 +158,15 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr } } - // Check if $current is a function and if so, call it passing the store. - if ( is_callable( $current ) ) { + /* + * Check if $current is an anonymous function or an arrow function, and if + * so, call it passing the store. Other types of callables are ignored in + * purpose, as arbitrary strings or arrays could be wrongly evaluated as + * "callables". + * + * E.g., "file" is an string and a "callable" (the "file" function exists). + */ + if ( $current instanceof Closure ) { $current = call_user_func( $current, $store ); } From 0f4c0f7f8dcb42bf2ac285163a844c4b354e347e Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 16:49:17 +0200 Subject: [PATCH 08/17] Improve negation operator code style --- .../interactivity-api/directive-processing.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index d09d7413767c89..6583176eecbd19 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -140,14 +140,12 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr /* * Check first if the directive path is preceded by a negator operator (!), - * indicating that the value obtained from the Interactivity Store using the - * subsequent path should be negated. + * indicating that the value obtained from the Interactivity Store (or the + * passed context) using the subsequent path should be negated. */ - if ( '!' === $path[0] ) { - $path = substr( $path, 1 ); - $has_negation_operator = true; - } + $should_negate_value = '!' === $path[0]; + $path = $should_negate_value ? substr( $path, 1 ) : $path; $path_segments = explode( '.', $path ); $current = $store; foreach ( $path_segments as $p ) { @@ -171,5 +169,5 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr } // Return the opposite if it has a negator operator (!). - return isset( $has_negation_operator ) ? ! $current : $current; + return $should_negate_value ? ! $current : $current; } From 29619eb6c9cc381ea2c964a940cd21d2dc328d7c Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 17:05:27 +0200 Subject: [PATCH 09/17] Do not lower-case tags --- lib/experimental/interactivity-api/directive-processing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 6583176eecbd19..01ef2fc531be71 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -69,7 +69,7 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives $tag_stack = array(); while ( $tags->next_tag( array( 'tag_closers' => 'visit' ) ) ) { - $tag_name = strtolower( $tags->get_tag() ); + $tag_name = $tags->get_tag(); // Is this a tag that closes the latest opening tag? if ( $tags->is_tag_closer() ) { From 5c651e105bf470514f8cd43e204894584b46beae Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 17:11:44 +0200 Subject: [PATCH 10/17] Use static parse_attribute_name inside directive processors --- lib/experimental/interactivity-api/directives/wp-bind.php | 2 +- lib/experimental/interactivity-api/directives/wp-class.php | 2 +- lib/experimental/interactivity-api/directives/wp-style.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/experimental/interactivity-api/directives/wp-bind.php b/lib/experimental/interactivity-api/directives/wp-bind.php index d65f1df16ac640..54be4a9faeb7d2 100644 --- a/lib/experimental/interactivity-api/directives/wp-bind.php +++ b/lib/experimental/interactivity-api/directives/wp-bind.php @@ -20,7 +20,7 @@ function gutenberg_interactivity_process_wp_bind( $tags, $context ) { $prefixed_attributes = $tags->get_attribute_names_with_prefix( 'data-wp-bind--' ); foreach ( $prefixed_attributes as $attr ) { - list( , $bound_attr ) = explode( '--', $attr ); + list( , $bound_attr ) = WP_Directive_Processor::parse_attribute_name( $attr ); if ( empty( $bound_attr ) ) { continue; } diff --git a/lib/experimental/interactivity-api/directives/wp-class.php b/lib/experimental/interactivity-api/directives/wp-class.php index 93c3b4d4a00998..741cc75b42c60e 100644 --- a/lib/experimental/interactivity-api/directives/wp-class.php +++ b/lib/experimental/interactivity-api/directives/wp-class.php @@ -20,7 +20,7 @@ function gutenberg_interactivity_process_wp_class( $tags, $context ) { $prefixed_attributes = $tags->get_attribute_names_with_prefix( 'data-wp-class--' ); foreach ( $prefixed_attributes as $attr ) { - list( , $class_name ) = explode( '--', $attr ); + list( , $class_name ) = WP_Directive_Processor::parse_attribute_name( $attr ); if ( empty( $class_name ) ) { continue; } diff --git a/lib/experimental/interactivity-api/directives/wp-style.php b/lib/experimental/interactivity-api/directives/wp-style.php index f87a85f099a0ea..9c37f9082c2c0b 100644 --- a/lib/experimental/interactivity-api/directives/wp-style.php +++ b/lib/experimental/interactivity-api/directives/wp-style.php @@ -20,7 +20,7 @@ function gutenberg_interactivity_process_wp_style( $tags, $context ) { $prefixed_attributes = $tags->get_attribute_names_with_prefix( 'data-wp-style--' ); foreach ( $prefixed_attributes as $attr ) { - list( , $style_name ) = explode( '--', $attr ); + list( , $style_name ) = WP_Directive_Processor::parse_attribute_name( $attr ); if ( empty( $style_name ) ) { continue; } From fc7ab8802676f4c8f5164bd2e36f7b4789f24739 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 17:16:42 +0200 Subject: [PATCH 11/17] Add basic error handling in wp-context --- lib/experimental/interactivity-api/directives/wp-context.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directives/wp-context.php b/lib/experimental/interactivity-api/directives/wp-context.php index 68a436aaaca8de..5e3c5a140b2b0d 100644 --- a/lib/experimental/interactivity-api/directives/wp-context.php +++ b/lib/experimental/interactivity-api/directives/wp-context.php @@ -24,7 +24,10 @@ function gutenberg_interactivity_process_wp_context( $tags, $context ) { } $new_context = json_decode( $value, true ); - // TODO: Error handling. + if ( null === $new_context ) { + // Invalid JSON defined in the directive. + return; + } $context->set_context( $new_context ); } From 10abf3047b1dd304b988973d3a23dae758496b6b Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 17:25:50 +0200 Subject: [PATCH 12/17] Fix hidden identation errors --- lib/experimental/interactivity-api/directive-processing.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 01ef2fc531be71..ab2f0620d31441 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -94,8 +94,8 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives foreach ( $tags->get_attribute_names_with_prefix( $prefix ) as $name ) { /* * Removes the part after the double hyphen before looking for - * the directive processor inside `$directives`, e.g., "wp-bind" - * from "wp-bind--src" and "wp-context" from "wp-context" etc... + * the directive processor inside `$directives`, e.g., "wp-bind" + * from "wp-bind--src" and "wp-context" from "wp-context" etc... */ list( $type ) = WP_Directive_Processor::parse_attribute_name( $name ); if ( array_key_exists( $type, $directives ) ) { From 364e07337b400692a9a63c1c9ccef9d10ea10a1d Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 19:57:59 +0200 Subject: [PATCH 13/17] Use the correct variable name --- lib/experimental/interactivity-api/directive-processing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index ab2f0620d31441..93bacc637206b3 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -99,7 +99,7 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives */ list( $type ) = WP_Directive_Processor::parse_attribute_name( $name ); if ( array_key_exists( $type, $directives ) ) { - $attributes[] = $name; + $attributes[] = $type; } } From b0252c382f4a572790e184ae475b9f285fff7b36 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Fri, 16 Jun 2023 19:59:42 +0200 Subject: [PATCH 14/17] Fix test for evaluating functions --- .../directive-processing-test.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/phpunit/experimental/interactivity-api/directive-processing-test.php b/phpunit/experimental/interactivity-api/directive-processing-test.php index 811305f1b71983..bb2e95ec3c4f61 100644 --- a/phpunit/experimental/interactivity-api/directive-processing-test.php +++ b/phpunit/experimental/interactivity-api/directive-processing-test.php @@ -127,7 +127,7 @@ public function test_evaluate_function_should_return_null_for_unresolved_paths() $this->assertNull( gutenberg_interactivity_evaluate_reference( 'this.property.doesnt.exist' ) ); } - public function test_evaluate_function_should_execute_functions() { + public function test_evaluate_function_should_execute_anonymous_functions() { $context = new WP_Directive_Context( array( 'count' => 2 ) ); $helper = new Helper_Class; @@ -140,6 +140,7 @@ public function test_evaluate_function_should_execute_functions() { 'anonymous_function' => function( $store ) { return $store['state']['count'] + $store['context']['count']; }, + // Other types of callables should not be executed. 'function_name' => 'gutenberg_test_process_directives_helper_increment', 'class_method' => array( $helper, 'increment' ), 'class_static_method' => 'Helper_Class::static_increment', @@ -149,8 +150,23 @@ public function test_evaluate_function_should_execute_functions() { ); $this->assertSame( 5, gutenberg_interactivity_evaluate_reference( 'selectors.anonymous_function', $context->get_context() ) ); - $this->assertSame( 5, gutenberg_interactivity_evaluate_reference( 'selectors.function_name', $context->get_context() ) ); - $this->assertSame( 5, gutenberg_interactivity_evaluate_reference( 'selectors.class_static_method', $context->get_context() ) ); - $this->assertSame( 5, gutenberg_interactivity_evaluate_reference( 'selectors.class_static_method_as_array', $context->get_context() ) ); + $this->assertSame( + 'gutenberg_test_process_directives_helper_increment', + gutenberg_interactivity_evaluate_reference( 'selectors.function_name', $context->get_context() ) + + ); + $this->assertSame( + array( $helper, 'increment' ), + gutenberg_interactivity_evaluate_reference( 'selectors.class_method', $context->get_context() ) + + ); + $this->assertSame( + 'Helper_Class::static_increment', + gutenberg_interactivity_evaluate_reference( 'selectors.class_static_method', $context->get_context() ) + ); + $this->assertSame( + array( 'Helper_Class', 'static_increment' ), + gutenberg_interactivity_evaluate_reference( 'selectors.class_static_method_as_array', $context->get_context() ) + ); } } From 63fe0ffd8b8e3faffd3e3989a52ad71f1f78535f Mon Sep 17 00:00:00 2001 From: David Arenas Date: Mon, 19 Jun 2023 10:53:37 +0200 Subject: [PATCH 15/17] Remove references to "attribute" directives --- .../interactivity-api/directive-processing.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 93bacc637206b3..88161223063260 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -81,10 +81,7 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives if ( $latest_opening_tag_name === $tag_name ) { array_pop( $tag_stack ); - /* - * If the matching opening tag didn't have any attribute directives, - * we move on. - */ + // If the matching opening tag didn't have any directives, we move on. if ( 0 === count( $attributes ) ) { continue; } @@ -104,9 +101,9 @@ function gutenberg_interactivity_process_directives( $tags, $prefix, $directives } /* - * If this is an open tag, and if it either has attribute directives, or - * if we're inside a tag that does, take note of this tag and its - * attribute directives so we can call its directive processor once we + * If this is an open tag, and if it either has directives, or if + * we're inside a tag that does, take note of this tag and its + * directives so we can call its directive processor once we * encounter the matching closing tag. */ if ( From ae67933567874a64f038002c8c5d29aa8ab187d3 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Mon, 19 Jun 2023 11:28:26 +0200 Subject: [PATCH 16/17] Remove emtpy lines in multi-line function calls --- .../interactivity-api/directive-processing-test.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpunit/experimental/interactivity-api/directive-processing-test.php b/phpunit/experimental/interactivity-api/directive-processing-test.php index bb2e95ec3c4f61..4da0a4a85ac3c0 100644 --- a/phpunit/experimental/interactivity-api/directive-processing-test.php +++ b/phpunit/experimental/interactivity-api/directive-processing-test.php @@ -153,12 +153,10 @@ public function test_evaluate_function_should_execute_anonymous_functions() { $this->assertSame( 'gutenberg_test_process_directives_helper_increment', gutenberg_interactivity_evaluate_reference( 'selectors.function_name', $context->get_context() ) - ); $this->assertSame( array( $helper, 'increment' ), gutenberg_interactivity_evaluate_reference( 'selectors.class_method', $context->get_context() ) - ); $this->assertSame( 'Helper_Class::static_increment', From 06620e9870ae33381a0005e2e49c8eb589670e90 Mon Sep 17 00:00:00 2001 From: David Arenas Date: Mon, 19 Jun 2023 14:06:13 +0200 Subject: [PATCH 17/17] Fix typo --- lib/experimental/interactivity-api/directive-processing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/experimental/interactivity-api/directive-processing.php b/lib/experimental/interactivity-api/directive-processing.php index 88161223063260..0f2af5da0f8044 100644 --- a/lib/experimental/interactivity-api/directive-processing.php +++ b/lib/experimental/interactivity-api/directive-processing.php @@ -155,7 +155,7 @@ function gutenberg_interactivity_evaluate_reference( $path, array $context = arr /* * Check if $current is an anonymous function or an arrow function, and if - * so, call it passing the store. Other types of callables are ignored in + * so, call it passing the store. Other types of callables are ignored on * purpose, as arbitrary strings or arrays could be wrongly evaluated as * "callables". *