Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty attrs. #54496

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@
*/
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 @@ -69,11 +61,10 @@
* @return array[]
*/
public function parse( $document ) {
$this->document = $document;

Check warning on line 64 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 1 space but found 4 spaces
$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 @@
*/
$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 @@
* @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
Loading