Skip to content

Commit

Permalink
Remove empty attrs.
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Sep 15, 2023
1 parent 8a43c85 commit 2cc7fc5
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ class WP_Block_Parser {
*/
public $stack;

/**
* Empty associative array, here due to PHP quirks
*
* @since 4.4.0
* @var array empty associative array
*/
public $empty_attrs;

/**
* Parses a document and returns a list of block structures
*
Expand All @@ -73,7 +65,6 @@ public function parse( $document ) {
$this->offset = 0;

Check warning on line 65 in packages/block-serialization-default-parser/class-wp-block-parser.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Equals sign not aligned with surrounding assignments; expected 3 spaces but found 6 spaces
$this->output = array();

Check warning on line 66 in packages/block-serialization-default-parser/class-wp-block-parser.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Equals sign not aligned with surrounding assignments; expected 3 spaces but found 6 spaces
$this->stack = array();

Check warning on line 67 in packages/block-serialization-default-parser/class-wp-block-parser.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Equals sign not aligned with surrounding assignments; expected 4 spaces but found 7 spaces
$this->empty_attrs = array();

while ( $this->proceed() ) {
continue;
Expand Down Expand Up @@ -287,7 +278,7 @@ public function next_token() {
*/
$attrs = $has_attrs
? json_decode( $matches['attrs'][0], /* as-associative */ true )
: $this->empty_attrs;
: array();

/*
* This state isn't allowed
Expand Down Expand Up @@ -318,7 +309,7 @@ public function next_token() {
* @return WP_Block_Parser_Block freeform block object.
*/
public function freeform( $inner_html ) {
return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $inner_html, array( $inner_html ) );
return new WP_Block_Parser_Block( null, array(), array(), $inner_html, array( $inner_html ) );
}

/**
Expand Down

0 comments on commit 2cc7fc5

Please sign in to comment.